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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee8451d53e20a0f4431a7122a053ac57615f59cd
4
- data.tar.gz: a22b9fa2192e54c2af340af5542527fb63917d82
3
+ metadata.gz: d720dbadc2626259a47ab8400a484486f88306b1
4
+ data.tar.gz: f7644c90812513c80bf997b180642bb2b6d29db9
5
5
  SHA512:
6
- metadata.gz: 2724f5df019b53e7da0877d466f88d4906e750b21b74f88acd57d95fe631a6a1e78195cfb4adcf7b3dcb878f449ed2f85e083f655cb10bfdbc18ae246fecd44d
7
- data.tar.gz: ffcb83715c9cc1d7fb035465fb3b4330ebc873b039e9e1cdc22998602f64287de7ddfa1e3fb1886a72803c65e0543a4fe0bbc490d35b1952658ec9c614da6787
6
+ metadata.gz: be52dda90d6a38a6dc3f8fb62505ffc1168c3c3d7042aadf9575629631c3bff5db6487f86e177cc1f9e052a8ffdfe1eac060968bea1c70a89dfe57ff2d5ddaa6
7
+ data.tar.gz: bd778fd7ef7bde45be00c14bd29bcdec4626eafc023e3761c8dbe32b54f5a58dae9bdea4343d5c9a7467d67cbc8676dc836741fd97dca9f88b66b4250175a727
@@ -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] = '/youtube/v3/videos'
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']}
@@ -23,6 +23,7 @@ module Yt
23
23
  has_attribute :caption
24
24
  has_attribute :licensed_content
25
25
  has_attribute :content_rating, default: {}
26
+ has_attribute :item_count
26
27
 
27
28
  def youtube_rating
28
29
  content_rating['ytRating']
@@ -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.
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.25.9'
2
+ VERSION = '0.25.10'
3
3
  end
@@ -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.9
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-07 00:00:00.000000000 Z
11
+ date: 2015-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport