yt 0.25.9 → 0.25.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/yt/collections/content_details.rb +3 -2
- data/lib/yt/collections/playlist_items.rb +1 -1
- data/lib/yt/models/content_detail.rb +1 -0
- data/lib/yt/models/playlist.rb +8 -0
- data/lib/yt/version.rb +1 -1
- data/spec/requests/as_account/playlist_spec.rb +1 -0
- data/spec/requests/as_server_app/playlist_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d720dbadc2626259a47ab8400a484486f88306b1
|
|
4
|
+
data.tar.gz: f7644c90812513c80bf997b180642bb2b6d29db9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be52dda90d6a38a6dc3f8fb62505ffc1168c3c3d7042aadf9575629631c3bff5db6487f86e177cc1f9e052a8ffdfe1eac060968bea1c70a89dfe57ff2d5ddaa6
|
|
7
|
+
data.tar.gz: bd778fd7ef7bde45be00c14bd29bcdec4626eafc023e3761c8dbe32b54f5a58dae9bdea4343d5c9a7467d67cbc8676dc836741fd97dca9f88b66b4250175a727
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,10 @@ For more information about changelogs, check
|
|
|
6
6
|
[Keep a Changelog](http://keepachangelog.com) and
|
|
7
7
|
[Vandamme](http://tech-angels.github.io/vandamme).
|
|
8
8
|
|
|
9
|
+
## 0.25.10 - 2015-10-29
|
|
10
|
+
|
|
11
|
+
* [FEATURE] Add Playlist#item_count
|
|
12
|
+
|
|
9
13
|
## 0.25.9 - 2015-10-07
|
|
10
14
|
|
|
11
15
|
* [ENHANCEMENT] Add newly available traffic source: "Playlist page"
|
|
@@ -16,9 +16,10 @@ module Yt
|
|
|
16
16
|
# content detail of a resource, for instance a video.
|
|
17
17
|
# @see https://developers.google.com/youtube/v3/docs/videos#resource
|
|
18
18
|
def list_params
|
|
19
|
+
endpoint = @parent.kind.pluralize.camelize :lower
|
|
19
20
|
super.tap do |params|
|
|
20
21
|
params[:params] = content_details_params
|
|
21
|
-
params[:path] =
|
|
22
|
+
params[:path] = "/youtube/v3/#{endpoint}"
|
|
22
23
|
end
|
|
23
24
|
end
|
|
24
25
|
|
|
@@ -27,4 +28,4 @@ module Yt
|
|
|
27
28
|
end
|
|
28
29
|
end
|
|
29
30
|
end
|
|
30
|
-
end
|
|
31
|
+
end
|
|
@@ -25,7 +25,7 @@ module Yt
|
|
|
25
25
|
if included_relationships.include?(:video)
|
|
26
26
|
video_ids = items.map{|item| item['snippet']['resourceId']['videoId']}.uniq
|
|
27
27
|
conditions = {id: video_ids.join(',')}
|
|
28
|
-
conditions[:part] = 'snippet,status,statistics'
|
|
28
|
+
conditions[:part] = 'snippet,status,statistics,contentDetails'
|
|
29
29
|
videos = Collections::Videos.new(auth: @auth).where conditions
|
|
30
30
|
items.each do |item|
|
|
31
31
|
video = videos.find{|v| v.id == item['snippet']['resourceId']['videoId']}
|
data/lib/yt/models/playlist.rb
CHANGED
|
@@ -41,6 +41,14 @@ module Yt
|
|
|
41
41
|
# @return [Array<String>] the list of tags attached to the playlist.
|
|
42
42
|
delegate :tags, to: :snippet
|
|
43
43
|
|
|
44
|
+
### STATISTICS ###
|
|
45
|
+
|
|
46
|
+
has_one :content_detail
|
|
47
|
+
|
|
48
|
+
# @!attribute [r] item_count
|
|
49
|
+
# @return [Integer] the number of items in the playlist.
|
|
50
|
+
delegate :item_count, to: :content_detail
|
|
51
|
+
|
|
44
52
|
### ACTIONS (UPLOAD, UPDATE, DELETE) ###
|
|
45
53
|
|
|
46
54
|
# Deletes the playlist.
|
data/lib/yt/version.rb
CHANGED
|
@@ -18,6 +18,7 @@ describe Yt::Playlist, :device_app do
|
|
|
18
18
|
expect(playlist.channel_id).to be_a String
|
|
19
19
|
expect(playlist.channel_title).to be_a String
|
|
20
20
|
expect(playlist.privacy_status).to be_a String
|
|
21
|
+
expect(playlist.item_count).to be_an Integer
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
describe '.playlist_items' do
|
|
@@ -16,6 +16,7 @@ describe Yt::Playlist, :server_app do
|
|
|
16
16
|
expect(playlist.tags).to be_an Array
|
|
17
17
|
expect(playlist.channel_id).to be_a String
|
|
18
18
|
expect(playlist.channel_title).to be_a String
|
|
19
|
+
expect(playlist.item_count).to be_an Integer
|
|
19
20
|
end
|
|
20
21
|
|
|
21
22
|
it { expect(playlist.status).to be_a Yt::Status }
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yt
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.25.
|
|
4
|
+
version: 0.25.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Claudio Baccigalupo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-10-
|
|
11
|
+
date: 2015-10-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|