yt 0.25.31 → 0.25.32
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/videos.rb +10 -7
- data/lib/yt/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7575ef55d789bc1593546bcf77b7b5848c368b28
|
|
4
|
+
data.tar.gz: 5f5ced71d9ecc23625250b485051d3570ca85fc2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: beed739ec7eee33a1eea1cfcce8e23094b2516ebb469ab212b3508f57a2db6b2cbbcbb3f6d8caf90b2b5f6ab35136fa052d947a8c1cbd18e36b82dee5fd9459a
|
|
7
|
+
data.tar.gz: d59ecde5eefcfec8e43ec2bbccd130273240ea21b94f8d62e086b61a29f3a3bfbc5b765f4dc3992aa83129dc8ed241d5d26fb68a9617fb19e83694c58f30751d
|
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.32 - 2016-04-12
|
|
10
|
+
|
|
11
|
+
* [BUGFIX] Fix where videos did not eager load claims or categories in subsequent requests.
|
|
12
|
+
|
|
9
13
|
## 0.25.31 - 2016-04-11
|
|
10
14
|
|
|
11
15
|
* [BUGFIX] Don’t try to instantiate video.claim if a video does not have a claim.
|
|
@@ -33,13 +33,16 @@ module Yt
|
|
|
33
33
|
|
|
34
34
|
def eager_load_items_from(items)
|
|
35
35
|
if included_relationships.any?
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
associations = [:claim, :category]
|
|
37
|
+
if (included_relationships & associations).any?
|
|
38
|
+
included_relationships.append(:snippet).uniq!
|
|
39
|
+
end
|
|
39
40
|
|
|
40
41
|
ids = items.map{|item| item['id']['videoId']}
|
|
41
|
-
parts = included_relationships.map
|
|
42
|
-
|
|
42
|
+
parts = (included_relationships - associations).map do |r|
|
|
43
|
+
r.to_s.camelize(:lower)
|
|
44
|
+
end
|
|
45
|
+
conditions = { id: ids.join(','), part: parts.join(',') }
|
|
43
46
|
videos = Collections::Videos.new(auth: @auth).where conditions
|
|
44
47
|
|
|
45
48
|
items.each do |item|
|
|
@@ -54,7 +57,7 @@ module Yt
|
|
|
54
57
|
end if video
|
|
55
58
|
end
|
|
56
59
|
|
|
57
|
-
if
|
|
60
|
+
if included_relationships.include? :claim
|
|
58
61
|
video_ids = items.map{|item| item['id']['videoId']}.uniq
|
|
59
62
|
conditions = { video_id: video_ids.join(',') }
|
|
60
63
|
claims = @parent.claims.where conditions
|
|
@@ -64,7 +67,7 @@ module Yt
|
|
|
64
67
|
end
|
|
65
68
|
end
|
|
66
69
|
|
|
67
|
-
if
|
|
70
|
+
if included_relationships.include? :category
|
|
68
71
|
category_ids = items.map{|item| item['snippet']['categoryId']}.uniq
|
|
69
72
|
conditions = {id: category_ids.join(',')}
|
|
70
73
|
video_categories = Collections::VideoCategories.new(auth: @auth).where conditions
|
data/lib/yt/version.rb
CHANGED