tmdby 1.2.1 → 1.3.0
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/README.md +2 -1
- data/lib/tmdby/version.rb +1 -1
- data/lib/tmdby/wrappers/guest_sessions.rb +16 -2
- data/lib/tmdby/wrappers/movies.rb +7 -8
- data/lib/tmdby/wrappers/search.rb +0 -8
- data/lib/tmdby/wrappers/tv.rb +16 -6
- data/lib/tmdby/wrappers/tv_episodes.rb +2 -3
- data/lib/tmdby/wrappers/tv_seasons.rb +5 -4
- data/tests/minitest/wrappers/guest_sessions_test.rb +13 -1
- data/tests/minitest/wrappers/lists_test.rb +6 -2
- data/tests/minitest/wrappers/movies_test.rb +8 -9
- data/tests/minitest/wrappers/search_test.rb +0 -8
- data/tests/minitest/wrappers/tv_test.rb +8 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ce8b3e1ec242291876f7f35f7c9558eb20507f7
|
|
4
|
+
data.tar.gz: e06604515db074b4d26b8103709d79ee43e1a5c3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e2b908a8e7eb11fcdbf786ba52f188bdd85194bc97e96bef0580941d9b1b50110c59bd7b697a48ec37f06581f18f31efcf2b8df1c80b3d4bc1023dfde39c4e8
|
|
7
|
+
data.tar.gz: 4104d8de83e7cf05ef7dc2921de14efcfed8a7f8023ae04548a5e48ed870a031d5f9b81c7b2c80be0a18ab8cb53e4802e3270cfcd54027d7fc744c9e3161d02a
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
TMDBY : a Ruby wrapper for the [TMDB API](
|
|
1
|
+
TMDBY : a Ruby wrapper for the [TMDB API](https://developers.themoviedb.org/3/getting-started)
|
|
2
2
|
---------------
|
|
3
3
|
|
|
4
4
|
[](https://badge.fury.io/rb/tmdby)
|
|
@@ -106,6 +106,7 @@ Changelog
|
|
|
106
106
|
|
|
107
107
|
[TMDB API updates](https://www.themoviedb.org/documentation/api/updates)
|
|
108
108
|
|
|
109
|
+
- 2016-10-17 Add recommendation api , up-to-date with "Captain America" TMDB API update [See blog post](https://blog.themoviedb.org/september-updates-4342b9c71c0f)
|
|
109
110
|
- 2016-01-27 Add movie/id/release_dates api [See blog post](https://medium.com/tmdb-news/multiple-release-dates-per-country-and-by-type-8b2a5bf0630)
|
|
110
111
|
- 2015-10-30 Up-to-date with "Jurassic World" TMDB API update
|
|
111
112
|
|
data/lib/tmdby/version.rb
CHANGED
|
@@ -3,9 +3,23 @@ module Tmdby
|
|
|
3
3
|
|
|
4
4
|
@root = "guest_session"
|
|
5
5
|
|
|
6
|
-
# Get
|
|
6
|
+
# Get the rated movies for a guest session.
|
|
7
7
|
def self.rated_movies(guest_session_id, optional_params = {})
|
|
8
|
-
self.fetch "#{guest_session_id}/
|
|
8
|
+
self.fetch "#{guest_session_id}/rated/movies",
|
|
9
|
+
optional_params,
|
|
10
|
+
authorized_params: ["page", "language", "sort_by", "sort_order"]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Get the rated TV shows for a guest session.
|
|
14
|
+
def self.rated_tv(guest_session_id, optional_params = {})
|
|
15
|
+
self.fetch "#{guest_session_id}/rated/tv",
|
|
16
|
+
optional_params,
|
|
17
|
+
authorized_params: ["page", "language", "sort_by", "sort_order"]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Get the rated TV episodes for a guest session.
|
|
21
|
+
def self.rated_tv_episodes(guest_session_id, optional_params = {})
|
|
22
|
+
self.fetch "#{guest_session_id}/rated/tv/episodes",
|
|
9
23
|
optional_params,
|
|
10
24
|
authorized_params: ["page", "language", "sort_by", "sort_order"]
|
|
11
25
|
end
|
|
@@ -45,13 +45,6 @@ module Tmdby
|
|
|
45
45
|
authorized_params: ["append_to_response"]
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
# Get the release date and certification information by country for a specific movie id.
|
|
49
|
-
def self.releases(id, optional_params = {})
|
|
50
|
-
self.fetch "#{id}/releases",
|
|
51
|
-
optional_params,
|
|
52
|
-
authorized_params: ["append_to_response"]
|
|
53
|
-
end
|
|
54
|
-
|
|
55
48
|
# Get the release dates, certifications and related information by country for a specific movie id.
|
|
56
49
|
def self.release_dates(id, optional_params = {})
|
|
57
50
|
self.fetch "#{id}/release_dates",
|
|
@@ -98,7 +91,7 @@ module Tmdby
|
|
|
98
91
|
def self.changes(id, optional_params = {})
|
|
99
92
|
self.fetch "#{id}/changes",
|
|
100
93
|
optional_params,
|
|
101
|
-
authorized_params: ["start_date", "end_date"]
|
|
94
|
+
authorized_params: ["start_date", "end_date", "page"]
|
|
102
95
|
end
|
|
103
96
|
|
|
104
97
|
# This method lets users rate a movie.
|
|
@@ -154,6 +147,12 @@ module Tmdby
|
|
|
154
147
|
authorized_params: ["page", "language"]
|
|
155
148
|
end
|
|
156
149
|
|
|
150
|
+
# Get a list of recommended movies for a movie.
|
|
151
|
+
def self.recommendations(id, optional_params = {})
|
|
152
|
+
self.fetch "#{id}/recommendations",
|
|
153
|
+
optional_params,
|
|
154
|
+
authorized_params: ["language", "page"]
|
|
155
|
+
end
|
|
157
156
|
|
|
158
157
|
end
|
|
159
158
|
end
|
|
@@ -27,14 +27,6 @@ module Tmdby
|
|
|
27
27
|
authorized_params: ["query", "page"]
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
# Search for lists by name and description.
|
|
31
|
-
def self.list(query, optional_params = {})
|
|
32
|
-
self.fetch "list",
|
|
33
|
-
optional_params,
|
|
34
|
-
query: query,
|
|
35
|
-
authorized_params: ["query", "page", "include_adult"]
|
|
36
|
-
end
|
|
37
|
-
|
|
38
30
|
# Search for movies by title.
|
|
39
31
|
def self.movie(query, optional_params = {})
|
|
40
32
|
self.fetch "movie",
|
data/lib/tmdby/wrappers/tv.rb
CHANGED
|
@@ -28,19 +28,21 @@ module Tmdby
|
|
|
28
28
|
def self.changes(id, optional_params = {})
|
|
29
29
|
self.fetch "#{id}/changes",
|
|
30
30
|
optional_params,
|
|
31
|
-
authorized_params: ["start_date", "end_date"]
|
|
31
|
+
authorized_params: ["start_date", "end_date", "page"]
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Get the content ratings for a specific TV show id.
|
|
35
|
-
def self.content_ratings(id)
|
|
36
|
-
self.fetch "#{id}/content_ratings"
|
|
35
|
+
def self.content_ratings(id, optional_params = {})
|
|
36
|
+
self.fetch "#{id}/content_ratings",
|
|
37
|
+
optional_params,
|
|
38
|
+
authorized_params: ["language"]
|
|
37
39
|
end
|
|
38
40
|
|
|
39
41
|
# Get the cast & crew information about a TV series.
|
|
40
42
|
def self.credits(id, optional_params = {})
|
|
41
43
|
self.fetch "#{id}/credits",
|
|
42
44
|
optional_params,
|
|
43
|
-
authorized_params: ["append_to_response"]
|
|
45
|
+
authorized_params: ["append_to_response", "language"]
|
|
44
46
|
end
|
|
45
47
|
|
|
46
48
|
# Get the external ids that we have stored for a TV series.
|
|
@@ -92,8 +94,9 @@ module Tmdby
|
|
|
92
94
|
end
|
|
93
95
|
|
|
94
96
|
# Get the list of translations that exist for a TV series.
|
|
95
|
-
def self.translations(id)
|
|
96
|
-
self.fetch "#{id}/translations"
|
|
97
|
+
def self.translations(id, optional_params = {})
|
|
98
|
+
self.fetch "#{id}/translations",
|
|
99
|
+
authorized_params: ["language"]
|
|
97
100
|
end
|
|
98
101
|
|
|
99
102
|
# Get the videos that have been added to a TV series (trailers, opening credits, etc...)
|
|
@@ -136,5 +139,12 @@ module Tmdby
|
|
|
136
139
|
authorized_params: ["page", "language"]
|
|
137
140
|
end
|
|
138
141
|
|
|
142
|
+
# Get the list of TV show recommendations for this item.
|
|
143
|
+
def self.recommendations(id, optional_params = {})
|
|
144
|
+
self.fetch "#{id}/recommendations",
|
|
145
|
+
optional_params,
|
|
146
|
+
authorized_params: ["language", "page"]
|
|
147
|
+
end
|
|
148
|
+
|
|
139
149
|
end
|
|
140
150
|
end
|
|
@@ -14,7 +14,7 @@ module Tmdby
|
|
|
14
14
|
def self.changes(id, optional_params = {})
|
|
15
15
|
self.fetch "episode/#{id}/changes",
|
|
16
16
|
optional_params,
|
|
17
|
-
authorized_params: ["start_date", "end_date"]
|
|
17
|
+
authorized_params: ["start_date", "end_date", "page"]
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
# This method lets users get the status of whether or not the TV episode has been rated.
|
|
@@ -32,8 +32,7 @@ module Tmdby
|
|
|
32
32
|
# Get the external ids for a TV episode by comabination of a season and episode number.
|
|
33
33
|
def self.external_ids(id, season_number, episode_number, optional_params = {})
|
|
34
34
|
self.fetch "#{id}/season/#{season_number}/episode/#{episode_number}/external_ids",
|
|
35
|
-
optional_params
|
|
36
|
-
authorized_params: ["language"]
|
|
35
|
+
optional_params
|
|
37
36
|
end
|
|
38
37
|
|
|
39
38
|
# Get the images (episode stills) for a TV episode by combination of a season and episode number.
|
|
@@ -14,26 +14,27 @@ module Tmdby
|
|
|
14
14
|
def self.changes(id, optional_params = {})
|
|
15
15
|
self.fetch "season/#{id}/changes",
|
|
16
16
|
optional_params,
|
|
17
|
-
authorized_params: ["start_date", "end_date"]
|
|
17
|
+
authorized_params: ["start_date", "end_date", "page"]
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
# This method lets users get the status of whether or not the TV episodes of a season have been rated.
|
|
21
21
|
def self.account_states(id, season_number, session_id)
|
|
22
22
|
self.fetch "#{id}/season/#{season_number}/account_states",
|
|
23
23
|
session_id: session_id,
|
|
24
|
-
authorized_params: ["session_id"]
|
|
24
|
+
authorized_params: ["session_id", "language"]
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
# Get the cast & crew credits for a TV season by season number.
|
|
28
28
|
def self.credits(id, season_number)
|
|
29
|
-
self.fetch "#{id}/season/#{season_number}/credits"
|
|
29
|
+
self.fetch "#{id}/season/#{season_number}/credits",
|
|
30
|
+
authorized_params: ["language"]
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
# Get the primary information about a TV season by its season number.
|
|
33
34
|
def self.external_ids(id, season_number, optional_params = {})
|
|
34
35
|
self.fetch "#{id}/season/#{season_number}/external_ids",
|
|
35
36
|
optional_params,
|
|
36
|
-
authorized_params: ["external_ids"]
|
|
37
|
+
authorized_params: ["external_ids", "language"]
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
# Get the images (posters) that we have stored for a TV season by season number.
|
|
@@ -11,7 +11,19 @@ class TestGuestSessions < MinitestWrapper
|
|
|
11
11
|
guest_session_id = Tmdby::Authentication.guest_session_new.body["guest_session_id"]
|
|
12
12
|
|
|
13
13
|
multi_assert @guest_sessions.rated_movies(guest_session_id),
|
|
14
|
-
uri: "http://api.themoviedb.org/3/guest_session/#{guest_session_id}/
|
|
14
|
+
uri: "http://api.themoviedb.org/3/guest_session/#{guest_session_id}/rated/movies?api_key=#{API_KEY}",
|
|
15
|
+
http_verb: "GET",
|
|
16
|
+
code: "200",
|
|
17
|
+
includes: "results"
|
|
18
|
+
|
|
19
|
+
multi_assert @guest_sessions.rated_tv(guest_session_id),
|
|
20
|
+
uri: "http://api.themoviedb.org/3/guest_session/#{guest_session_id}/rated/tv?api_key=#{API_KEY}",
|
|
21
|
+
http_verb: "GET",
|
|
22
|
+
code: "200",
|
|
23
|
+
includes: "results"
|
|
24
|
+
|
|
25
|
+
multi_assert @guest_sessions.rated_tv_episodes(guest_session_id),
|
|
26
|
+
uri: "http://api.themoviedb.org/3/guest_session/#{guest_session_id}/rated/tv/episodes?api_key=#{API_KEY}",
|
|
15
27
|
http_verb: "GET",
|
|
16
28
|
code: "200",
|
|
17
29
|
includes: "results"
|
|
@@ -14,7 +14,8 @@ class TestLists < MinitestWrapper
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def delete_list(id)
|
|
17
|
-
|
|
17
|
+
# seems like delete API is gone...
|
|
18
|
+
#@lists.delete id, @@session_id
|
|
18
19
|
end
|
|
19
20
|
|
|
20
21
|
def test_get
|
|
@@ -24,12 +25,14 @@ class TestLists < MinitestWrapper
|
|
|
24
25
|
uri: "http://api.themoviedb.org/3/list/#{list_id}?api_key=#{API_KEY}",
|
|
25
26
|
http_verb: "GET",
|
|
26
27
|
code: "200",
|
|
27
|
-
id: list_id
|
|
28
|
+
id: list_id.to_s #weird : this API returns ID as string
|
|
28
29
|
|
|
29
30
|
delete_list list_id
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
def test_delete
|
|
34
|
+
skip
|
|
35
|
+
|
|
33
36
|
list_id = get_id_new_list
|
|
34
37
|
|
|
35
38
|
multi_assert @lists.delete(list_id, @@session_id),
|
|
@@ -40,6 +43,7 @@ class TestLists < MinitestWrapper
|
|
|
40
43
|
end
|
|
41
44
|
|
|
42
45
|
def test_item_status
|
|
46
|
+
skip
|
|
43
47
|
list_id = get_id_new_list
|
|
44
48
|
|
|
45
49
|
# We add Movie#550 in the list
|
|
@@ -61,15 +61,6 @@ class TestMovies < MinitestWrapper
|
|
|
61
61
|
not_empty: "keywords"
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
-
def test_releases
|
|
65
|
-
multi_assert @movies.releases(550),
|
|
66
|
-
uri: "http://api.themoviedb.org/3/movie/550/releases?api_key=#{API_KEY}",
|
|
67
|
-
http_verb: "GET",
|
|
68
|
-
code: "200",
|
|
69
|
-
id: 550,
|
|
70
|
-
not_empty: "countries"
|
|
71
|
-
end
|
|
72
|
-
|
|
73
64
|
def test_release_dates
|
|
74
65
|
multi_assert @movies.release_dates(550),
|
|
75
66
|
uri: "http://api.themoviedb.org/3/movie/550/release_dates?api_key=#{API_KEY}",
|
|
@@ -194,5 +185,13 @@ class TestMovies < MinitestWrapper
|
|
|
194
185
|
includes: "results"
|
|
195
186
|
end
|
|
196
187
|
|
|
188
|
+
def test_recommendations
|
|
189
|
+
multi_assert @movies.recommendations(550),
|
|
190
|
+
uri: "http://api.themoviedb.org/3/movie/550/recommendations?api_key=#{API_KEY}",
|
|
191
|
+
http_verb: "GET",
|
|
192
|
+
code: "200",
|
|
193
|
+
not_empty: "results"
|
|
194
|
+
end
|
|
195
|
+
|
|
197
196
|
|
|
198
197
|
end
|
|
@@ -31,14 +31,6 @@ class TestSearch < MinitestWrapper
|
|
|
31
31
|
not_empty: "results"
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
def test_list
|
|
35
|
-
multi_assert @search.list("warner"),
|
|
36
|
-
uri: "http://api.themoviedb.org/3/search/list?query=warner&api_key=#{API_KEY}",
|
|
37
|
-
http_verb: "GET",
|
|
38
|
-
code: "200",
|
|
39
|
-
not_empty: "results"
|
|
40
|
-
end
|
|
41
|
-
|
|
42
34
|
def test_movie
|
|
43
35
|
multi_assert @search.movie("matrix"),
|
|
44
36
|
uri: "http://api.themoviedb.org/3/search/movie?query=matrix&api_key=#{API_KEY}",
|
|
@@ -180,4 +180,12 @@ class TestTv < MinitestWrapper
|
|
|
180
180
|
includes: "results"
|
|
181
181
|
end
|
|
182
182
|
|
|
183
|
+
def test_recommendations
|
|
184
|
+
multi_assert @tv.recommendations(1396),
|
|
185
|
+
uri: "http://api.themoviedb.org/3/tv/1396/recommendations?api_key=#{API_KEY}",
|
|
186
|
+
http_verb: "GET",
|
|
187
|
+
code: "200",
|
|
188
|
+
includes: "results"
|
|
189
|
+
end
|
|
190
|
+
|
|
183
191
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tmdby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aurélien Le Grand
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-10-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
144
144
|
version: '0'
|
|
145
145
|
requirements: []
|
|
146
146
|
rubyforge_project:
|
|
147
|
-
rubygems_version: 2.
|
|
147
|
+
rubygems_version: 2.5.1
|
|
148
148
|
signing_key:
|
|
149
149
|
specification_version: 4
|
|
150
150
|
summary: A Ruby wrapper for the TMDB API (http://docs.themoviedb.apiary.io/)
|