themoviedb 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +459 -0
- data/lib/themoviedb.rb +4 -5
- data/lib/themoviedb/api.rb +4 -5
- data/lib/themoviedb/collection.rb +6 -7
- data/lib/themoviedb/company.rb +7 -8
- data/lib/themoviedb/configuration.rb +2 -2
- data/lib/themoviedb/episode.rb +16 -17
- data/lib/themoviedb/find.rb +11 -12
- data/lib/themoviedb/genre.rb +53 -57
- data/lib/themoviedb/job.rb +3 -5
- data/lib/themoviedb/movie.rb +62 -63
- data/lib/themoviedb/person.rb +37 -33
- data/lib/themoviedb/resource.rb +19 -21
- data/lib/themoviedb/search.rb +30 -30
- data/lib/themoviedb/season.rb +16 -17
- data/lib/themoviedb/tv.rb +24 -25
- data/lib/themoviedb/version.rb +2 -1
- data/spec/company_spec.rb +31 -36
- data/spec/find_spec.rb +10 -13
- data/spec/movie_spec.rb +124 -129
- data/spec/person_spec.rb +53 -53
- data/spec/spec/vcr/find/search_imdb.yml +39 -0
- data/spec/spec_helper.rb +29 -0
- data/spec/tv_spec.rb +196 -217
- data/spec/vcr/company/detail.yml +67 -0
- data/spec/vcr/company/movies.yml +98 -0
- data/spec/vcr/find/search_imdb.yml +50 -0
- data/spec/vcr/find/search_tvdb.yml +52 -0
- data/spec/vcr/movie/alternative_titles_for_id.yml +69 -0
- data/spec/vcr/movie/cast_information_for_id.yml +109 -0
- data/spec/vcr/movie/changes_made.yml +60 -0
- data/spec/vcr/movie/credits_for_id.yml +99 -0
- data/spec/vcr/movie/crew_for_id.yml +109 -0
- data/spec/vcr/movie/detail.yml +93 -0
- data/spec/vcr/movie/detail_with_appended_response.yml +254 -0
- data/spec/vcr/movie/images.yml +62 -0
- data/spec/vcr/movie/keywords_for_id.yml +62 -0
- data/spec/vcr/movie/language_german.yml +112 -0
- data/spec/vcr/movie/movie_belongs_for_id.yml +89 -0
- data/spec/vcr/movie/now_playing.yml +90 -0
- data/spec/vcr/movie/popular.yml +96 -0
- data/spec/vcr/movie/releases_for_id.yml +60 -0
- data/spec/vcr/movie/return_latest_movie.yml +62 -0
- data/spec/vcr/movie/return_upcoming_movie.yml +186 -0
- data/spec/vcr/movie/similar_for_id.yml +180 -0
- data/spec/vcr/movie/top_rated.yml +190 -0
- data/spec/vcr/movie/trailers_for_id.yml +60 -0
- data/spec/vcr/movie/translations_for_id.yml +76 -0
- data/spec/vcr/person/changes.yml +50 -0
- data/spec/vcr/person/credits.yml +459 -0
- data/spec/vcr/person/detail.yml +65 -0
- data/spec/vcr/person/detail_with_appended_response.yml +762 -0
- data/spec/vcr/person/images.yml +50 -0
- data/spec/vcr/person/latest.yml +51 -0
- data/spec/vcr/person/popular.yml +125 -0
- data/spec/vcr/tv/cast.yml +74 -0
- data/spec/vcr/tv/crew.yml +74 -0
- data/spec/vcr/tv/detail.yml +63 -0
- data/spec/vcr/tv/detail_with_appeded_response.yml +76 -0
- data/spec/vcr/tv/external_ids.yml +60 -0
- data/spec/vcr/tv/images.yml +121 -0
- data/spec/vcr/tv/popular.yml +96 -0
- data/spec/vcr/tv/test_chuck.yml +52 -0
- data/spec/vcr/tv/top_rated.yml +84 -0
- data/themoviedb.gemspec +10 -35
- metadata +94 -9
data/lib/themoviedb.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'httparty'
|
3
3
|
|
4
|
-
|
5
|
-
require File.join(File.dirname(__FILE__),
|
4
|
+
%w(api search resource configuration).each do |inc|
|
5
|
+
require File.join(File.dirname(__FILE__), 'themoviedb', inc)
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
require File.join(File.dirname(__FILE__),
|
8
|
+
%w(movie tv season episode collection person company genre find job).each do |inc|
|
9
|
+
require File.join(File.dirname(__FILE__), 'themoviedb', inc)
|
10
10
|
end
|
11
|
-
|
data/lib/themoviedb/api.rb
CHANGED
@@ -11,14 +11,14 @@ module Tmdb
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.key(api_key)
|
14
|
-
|
14
|
+
config[:api_key] = api_key
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.language(lang)
|
18
|
-
if
|
19
|
-
|
18
|
+
if lang.nil?
|
19
|
+
config.delete(:language)
|
20
20
|
else
|
21
|
-
|
21
|
+
config[:language] = lang
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -33,6 +33,5 @@ module Tmdb
|
|
33
33
|
def self.set_response(hash)
|
34
34
|
@@response = hash
|
35
35
|
end
|
36
|
-
|
37
36
|
end
|
38
37
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Tmdb
|
2
2
|
class Collection < Resource
|
3
|
-
has_resource 'collection', :
|
3
|
+
has_resource 'collection', plural: 'collections'
|
4
4
|
|
5
|
-
#http://docs.themoviedb.apiary.io/#collections
|
5
|
+
# http://docs.themoviedb.apiary.io/#collections
|
6
6
|
@@fields = [
|
7
7
|
:backdrop_path,
|
8
8
|
:id,
|
@@ -15,11 +15,10 @@ module Tmdb
|
|
15
15
|
attr_accessor field
|
16
16
|
end
|
17
17
|
|
18
|
-
#Get all of the images for a particular collection by collection id.
|
19
|
-
def self.images(id,
|
20
|
-
search = Tmdb::Search.new("/#{
|
18
|
+
# Get all of the images for a particular collection by collection id.
|
19
|
+
def self.images(id, _conditions = {})
|
20
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/images")
|
21
21
|
search.fetch_response
|
22
22
|
end
|
23
|
-
|
24
23
|
end
|
25
|
-
end
|
24
|
+
end
|
data/lib/themoviedb/company.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Tmdb
|
2
2
|
class Company < Resource
|
3
|
-
has_resource 'company', :
|
3
|
+
has_resource 'company', plural: 'companies'
|
4
4
|
|
5
|
-
#http://docs.themoviedb.apiary.io/#companies
|
5
|
+
# http://docs.themoviedb.apiary.io/#companies
|
6
6
|
@@fields = [
|
7
7
|
:description,
|
8
8
|
:headquarters,
|
@@ -17,11 +17,10 @@ module Tmdb
|
|
17
17
|
attr_accessor field
|
18
18
|
end
|
19
19
|
|
20
|
-
#Get the list of movies associated with a particular company.
|
21
|
-
def self.movies(id,
|
22
|
-
search = Tmdb::Search.new("/#{
|
23
|
-
search.fetch
|
20
|
+
# Get the list of movies associated with a particular company.
|
21
|
+
def self.movies(id, _conditions = {})
|
22
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/movies")
|
23
|
+
search.fetch.collect { |result| Tmdb::Movie.new(result) }
|
24
24
|
end
|
25
|
-
|
26
25
|
end
|
27
|
-
end
|
26
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Tmdb
|
2
2
|
class Configuration
|
3
|
-
def initialize
|
3
|
+
def initialize
|
4
4
|
@params = {}
|
5
5
|
@resource = '/configuration'
|
6
6
|
self
|
@@ -37,7 +37,7 @@ module Tmdb
|
|
37
37
|
|
38
38
|
def fetch_response
|
39
39
|
options = @params.merge(Api.config)
|
40
|
-
response = Api.get(@resource, :
|
40
|
+
response = Api.get(@resource, query: options)
|
41
41
|
response.to_hash
|
42
42
|
end
|
43
43
|
|
data/lib/themoviedb/episode.rb
CHANGED
@@ -1,37 +1,36 @@
|
|
1
1
|
module Tmdb
|
2
2
|
class Episode < Resource
|
3
|
-
has_resource 'episode', :
|
3
|
+
has_resource 'episode', plural: 'episodes'
|
4
4
|
|
5
|
-
#Get the primary information about a TV episode by combination of a season and episode number.
|
6
|
-
def self.detail(id, season, episode, conditions={})
|
7
|
-
search = Tmdb::Search.new("/tv/#{
|
5
|
+
# Get the primary information about a TV episode by combination of a season and episode number.
|
6
|
+
def self.detail(id, season, episode, conditions = {})
|
7
|
+
search = Tmdb::Search.new("/tv/#{endpoint_id + id.to_s}/season/#{endpoint_id + season.to_s}/#{endpoints[:singular]}/#{endpoint_id + episode.to_s}")
|
8
8
|
search.filter(conditions)
|
9
9
|
search.fetch_response
|
10
10
|
end
|
11
11
|
|
12
|
-
#Get the TV episode cast credits by combination of season and episode number.
|
13
|
-
def self.cast(id, season, episode,
|
14
|
-
search = Tmdb::Search.new("/tv/#{
|
12
|
+
# Get the TV episode cast credits by combination of season and episode number.
|
13
|
+
def self.cast(id, season, episode, _conditions = {})
|
14
|
+
search = Tmdb::Search.new("/tv/#{endpoint_id + id.to_s}/season/#{endpoint_id + season.to_s}/#{endpoints[:singular]}/#{endpoint_id + episode.to_s}/credits")
|
15
15
|
search.fetch_response['cast']
|
16
16
|
end
|
17
17
|
|
18
|
-
#Get the TV episode crew credits by combination of season and episode number.
|
19
|
-
def self.crew(id, season, episode,
|
20
|
-
search = Tmdb::Search.new("/tv/#{
|
18
|
+
# Get the TV episode crew credits by combination of season and episode number.
|
19
|
+
def self.crew(id, season, episode, _conditions = {})
|
20
|
+
search = Tmdb::Search.new("/tv/#{endpoint_id + id.to_s}/season/#{endpoint_id + season.to_s}/#{endpoints[:singular]}/#{endpoint_id + episode.to_s}/credits")
|
21
21
|
search.fetch_response['crew']
|
22
22
|
end
|
23
23
|
|
24
|
-
#Get the external ids for a TV episode by comabination of a season and episode number.
|
25
|
-
def self.external_ids(id, season, episode,
|
26
|
-
search = Tmdb::Search.new("/tv/#{
|
24
|
+
# Get the external ids for a TV episode by comabination of a season and episode number.
|
25
|
+
def self.external_ids(id, season, episode, _conditions = {})
|
26
|
+
search = Tmdb::Search.new("/tv/#{endpoint_id + id.to_s}/season/#{endpoint_id + season.to_s}/#{endpoints[:singular]}/#{endpoint_id + episode.to_s}/external_ids")
|
27
27
|
search.fetch_response
|
28
28
|
end
|
29
29
|
|
30
|
-
#Get the images (episode stills) for a TV episode by combination of a season and episode number.
|
31
|
-
def self.images(id, season, episode,
|
32
|
-
search = Tmdb::Search.new("/tv/#{
|
30
|
+
# Get the images (episode stills) for a TV episode by combination of a season and episode number.
|
31
|
+
def self.images(id, season, episode, _conditions = {})
|
32
|
+
search = Tmdb::Search.new("/tv/#{endpoint_id + id.to_s}/season/#{endpoint_id + season.to_s}/#{endpoints[:singular]}/#{endpoint_id + episode.to_s}/images")
|
33
33
|
search.fetch_response
|
34
34
|
end
|
35
|
-
|
36
35
|
end
|
37
36
|
end
|
data/lib/themoviedb/find.rb
CHANGED
@@ -2,30 +2,29 @@ module Tmdb
|
|
2
2
|
class Find < Resource
|
3
3
|
has_resource 'find'
|
4
4
|
|
5
|
-
def self.imdb_id(id,
|
6
|
-
search = Tmdb::Search.new("/#{
|
5
|
+
def self.imdb_id(id, _conditions = {})
|
6
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}")
|
7
7
|
search.fetch_response(external_source: 'imdb_id')
|
8
8
|
end
|
9
9
|
|
10
|
-
def self.freebase_mid(id,
|
11
|
-
search = Tmdb::Search.new("/#{
|
10
|
+
def self.freebase_mid(id, _conditions = {})
|
11
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}")
|
12
12
|
search.fetch_response(external_source: 'freebase_mid')
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.freebase_id(id,
|
16
|
-
search = Tmdb::Search.new("/#{
|
15
|
+
def self.freebase_id(id, _conditions = {})
|
16
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}")
|
17
17
|
search.fetch_response(external_source: 'freebase_id')
|
18
18
|
end
|
19
19
|
|
20
|
-
def self.tvrage_id(id,
|
21
|
-
search = Tmdb::Search.new("/#{
|
20
|
+
def self.tvrage_id(id, _conditions = {})
|
21
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}")
|
22
22
|
search.fetch_response(external_source: 'tvrage_id')
|
23
23
|
end
|
24
24
|
|
25
|
-
def self.tvdb_id(id,
|
26
|
-
search = Tmdb::Search.new("/#{
|
25
|
+
def self.tvdb_id(id, _conditions = {})
|
26
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}")
|
27
27
|
search.fetch_response(external_source: 'tvdb_id')
|
28
28
|
end
|
29
|
-
|
30
29
|
end
|
31
|
-
end
|
30
|
+
end
|
data/lib/themoviedb/genre.rb
CHANGED
@@ -1,63 +1,59 @@
|
|
1
1
|
module Tmdb
|
2
|
-
|
3
|
-
def initialize(attributes={})
|
2
|
+
class Genre
|
3
|
+
def initialize(attributes = {})
|
4
4
|
attributes.each do |key, value|
|
5
|
-
if
|
6
|
-
|
5
|
+
instance_variable_set("@#{key}", value) if respond_to?(key.to_sym)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
# http://docs.themoviedb.apiary.io/#genres
|
10
|
+
@@fields = [
|
11
|
+
:id,
|
12
|
+
:page,
|
13
|
+
:total_pages,
|
14
|
+
:total_results,
|
15
|
+
:results
|
16
|
+
]
|
17
|
+
|
18
|
+
@@fields.each do |field|
|
19
|
+
attr_accessor field
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.search(query)
|
23
|
+
detail(list['genres'].detect { |g| g['name'] == query }['id'])
|
24
|
+
end
|
25
|
+
|
26
|
+
class << self
|
27
|
+
alias find search
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.list
|
31
|
+
search = Tmdb::Search.new('/genre/list')
|
32
|
+
search.fetch_response
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.detail(id, conditions = {})
|
36
|
+
url = "/genre/#{id}/movies"
|
37
|
+
unless conditions.empty?
|
38
|
+
url << '?'
|
39
|
+
conditions.each_with_index do |(key, value), index|
|
40
|
+
url << "#{key}=#{value}"
|
41
|
+
url << '&' if index != conditions.length - 1
|
7
42
|
end
|
8
43
|
end
|
44
|
+
search = Tmdb::Search.new(url)
|
45
|
+
new(search.fetch_response)
|
9
46
|
end
|
10
47
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
def self.search(query)
|
25
|
-
self.detail(self.list['genres'].detect { |g| g['name'] == query }['id'])
|
26
|
-
end
|
27
|
-
|
28
|
-
class << self
|
29
|
-
alias_method :find, :search
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.list
|
33
|
-
search = Tmdb::Search.new("/genre/list")
|
34
|
-
search.fetch_response
|
35
|
-
end
|
36
|
-
|
37
|
-
def self.detail(id, conditions={})
|
38
|
-
url = "/genre/#{id}/movies"
|
39
|
-
if !conditions.empty?
|
40
|
-
url << "?"
|
41
|
-
conditions.each_with_index do |(key, value), index|
|
42
|
-
url << "#{key}=#{value}"
|
43
|
-
if index != conditions.length - 1
|
44
|
-
url << "&"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
search = Tmdb::Search.new(url)
|
49
|
-
self.new(search.fetch_response)
|
50
|
-
end
|
51
|
-
|
52
|
-
def name
|
53
|
-
@name ||= self.class.list['genres'].detect { |g| g['id'] == @id }['name']
|
54
|
-
end
|
55
|
-
|
56
|
-
def get_page(page_number, conditions={})
|
57
|
-
if page_number != @page and page_number > 0 and page_number <= @total_pages
|
58
|
-
conditions.merge!({ :page => page_number })
|
59
|
-
self.class.detail(id, conditions)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
48
|
+
def name
|
49
|
+
@name ||= self.class.list['genres'].detect { |g| g['id'] == @id }['name']
|
50
|
+
end
|
51
|
+
|
52
|
+
def get_page(page_number, conditions = {})
|
53
|
+
if page_number != @page && page_number > 0 && page_number <= @total_pages
|
54
|
+
conditions[:page] = page_number
|
55
|
+
self.class.detail(id, conditions)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/lib/themoviedb/job.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
module Tmdb
|
2
2
|
class Job
|
3
|
-
def initialize(attributes={})
|
3
|
+
def initialize(attributes = {})
|
4
4
|
attributes.each do |key, value|
|
5
|
-
if
|
6
|
-
self.instance_variable_set("@#{key}", value)
|
7
|
-
end
|
5
|
+
instance_variable_set("@#{key}", value) if respond_to?(key.to_sym)
|
8
6
|
end
|
9
7
|
end
|
10
8
|
|
@@ -19,7 +17,7 @@ module Tmdb
|
|
19
17
|
end
|
20
18
|
|
21
19
|
def self.list
|
22
|
-
search = Tmdb::Search.new(
|
20
|
+
search = Tmdb::Search.new('/job/list')
|
23
21
|
search.fetch_response
|
24
22
|
end
|
25
23
|
end
|
data/lib/themoviedb/movie.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Tmdb
|
2
2
|
class Movie < Resource
|
3
|
-
has_resource 'movie', :
|
3
|
+
has_resource 'movie', plural: 'movies'
|
4
4
|
|
5
|
-
#http://docs.themoviedb.apiary.io/#movies
|
5
|
+
# http://docs.themoviedb.apiary.io/#movies
|
6
6
|
@@fields = [
|
7
7
|
:adult,
|
8
8
|
:backdrop_path,
|
@@ -43,119 +43,118 @@ module Tmdb
|
|
43
43
|
attr_accessor field
|
44
44
|
end
|
45
45
|
|
46
|
-
#Get the latest movie id. singular
|
46
|
+
# Get the latest movie id. singular
|
47
47
|
def self.latest
|
48
|
-
search = Tmdb::Search.new(
|
49
|
-
search.fetch_response
|
48
|
+
search = Tmdb::Search.new('/movie/latest')
|
49
|
+
new(search.fetch_response)
|
50
50
|
end
|
51
51
|
|
52
|
-
#Get the list of upcoming movies. This list refreshes every day. The maximum number of items this list will include is 100.
|
52
|
+
# Get the list of upcoming movies. This list refreshes every day. The maximum number of items this list will include is 100.
|
53
53
|
def self.upcoming
|
54
|
-
search = Tmdb::Search.new(
|
55
|
-
search.fetch
|
54
|
+
search = Tmdb::Search.new('/movie/upcoming')
|
55
|
+
search.fetch.collect { |result| new(result) }
|
56
56
|
end
|
57
57
|
|
58
|
-
#Get the list of movies playing in theatres. This list refreshes every day. The maximum number of items this list will include is 100.
|
58
|
+
# Get the list of movies playing in theatres. This list refreshes every day. The maximum number of items this list will include is 100.
|
59
59
|
def self.now_playing
|
60
|
-
search = Tmdb::Search.new(
|
61
|
-
search.fetch
|
60
|
+
search = Tmdb::Search.new('/movie/now_playing')
|
61
|
+
search.fetch.collect { |result| new(result) }
|
62
62
|
end
|
63
63
|
|
64
|
-
#Get the list of popular movies on The Movie Database. This list refreshes every day.
|
64
|
+
# Get the list of popular movies on The Movie Database. This list refreshes every day.
|
65
65
|
def self.popular
|
66
|
-
search = Tmdb::Search.new(
|
67
|
-
search.fetch
|
66
|
+
search = Tmdb::Search.new('/movie/popular')
|
67
|
+
search.fetch.collect { |result| new(result) }
|
68
68
|
end
|
69
69
|
|
70
|
-
#Get the list of top rated movies. By default, this list will only include movies that have 10 or more votes. This list refreshes every day.
|
70
|
+
# Get the list of top rated movies. By default, this list will only include movies that have 10 or more votes. This list refreshes every day.
|
71
71
|
def self.top_rated
|
72
|
-
search = Tmdb::Search.new(
|
73
|
-
search.fetch
|
72
|
+
search = Tmdb::Search.new('/movie/top_rated')
|
73
|
+
search.fetch.collect { |result| new(result) }
|
74
74
|
end
|
75
75
|
|
76
|
-
#Discover movies by different types of data like average rating, number of votes, genres and certifications.
|
77
|
-
def self.discover(conditions={})
|
78
|
-
search = Tmdb::Search.new(
|
76
|
+
# Discover movies by different types of data like average rating, number of votes, genres and certifications.
|
77
|
+
def self.discover(conditions = {})
|
78
|
+
search = Tmdb::Search.new('/discover/movie')
|
79
79
|
search.filter(conditions)
|
80
|
-
search.fetch
|
80
|
+
search.fetch.collect { |result| new(result) }
|
81
81
|
end
|
82
82
|
|
83
|
-
#Get the alternative titles for a specific movie id.
|
84
|
-
def self.alternative_titles(id,
|
85
|
-
search = Tmdb::Search.new("/#{
|
83
|
+
# Get the alternative titles for a specific movie id.
|
84
|
+
def self.alternative_titles(id, _conditions = {})
|
85
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/alternative_titles")
|
86
86
|
search.fetch_response
|
87
87
|
end
|
88
88
|
|
89
|
-
#Get the cast information for a specific movie id.
|
90
|
-
def self.casts(id,
|
91
|
-
search = Tmdb::Search.new("/#{
|
89
|
+
# Get the cast information for a specific movie id.
|
90
|
+
def self.casts(id, _conditions = {})
|
91
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/casts")
|
92
92
|
search.fetch_response['cast']
|
93
93
|
end
|
94
94
|
|
95
|
-
#Get the cast information for a specific movie id.
|
96
|
-
def self.crew(id,
|
97
|
-
search = Tmdb::Search.new("/#{
|
95
|
+
# Get the cast information for a specific movie id.
|
96
|
+
def self.crew(id, _conditions = {})
|
97
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/casts")
|
98
98
|
search.fetch_response['crew']
|
99
99
|
end
|
100
100
|
|
101
|
-
#Get the images (posters and backdrops) for a specific movie id.
|
102
|
-
def self.images(id,
|
103
|
-
search = Tmdb::Search.new("/#{
|
101
|
+
# Get the images (posters and backdrops) for a specific movie id.
|
102
|
+
def self.images(id, _conditions = {})
|
103
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/images")
|
104
104
|
search.fetch_response
|
105
105
|
end
|
106
106
|
|
107
|
-
#Get the plot keywords for a specific movie id.
|
108
|
-
def self.keywords(id,
|
109
|
-
search = Tmdb::Search.new("/#{
|
107
|
+
# Get the plot keywords for a specific movie id.
|
108
|
+
def self.keywords(id, _conditions = {})
|
109
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/keywords")
|
110
110
|
search.fetch_response
|
111
111
|
end
|
112
112
|
|
113
|
-
#Get the release date by country for a specific movie id.
|
114
|
-
def self.releases(id,
|
115
|
-
search = Tmdb::Search.new("/#{
|
113
|
+
# Get the release date by country for a specific movie id.
|
114
|
+
def self.releases(id, _conditions = {})
|
115
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/releases")
|
116
116
|
search.fetch_response
|
117
117
|
end
|
118
118
|
|
119
|
-
#Get the trailers for a specific movie id.
|
120
|
-
def self.trailers(id,
|
121
|
-
search = Tmdb::Search.new("/#{
|
119
|
+
# Get the trailers for a specific movie id.
|
120
|
+
def self.trailers(id, _conditions = {})
|
121
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/trailers")
|
122
122
|
search.fetch_response
|
123
123
|
end
|
124
124
|
|
125
|
-
#Get the translations for a specific movie id.
|
126
|
-
def self.translations(id,
|
127
|
-
search = Tmdb::Search.new("/#{
|
125
|
+
# Get the translations for a specific movie id.
|
126
|
+
def self.translations(id, _conditions = {})
|
127
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/translations")
|
128
128
|
search.fetch_response
|
129
129
|
end
|
130
130
|
|
131
|
-
#Get the similar movies for a specific movie id.
|
132
|
-
def self.similar_movies(id, conditions={})
|
133
|
-
search = Tmdb::Search.new("/#{
|
131
|
+
# Get the similar movies for a specific movie id.
|
132
|
+
def self.similar_movies(id, conditions = {})
|
133
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/similar_movies")
|
134
134
|
search.filter(conditions)
|
135
|
-
search.fetch
|
135
|
+
search.fetch.collect { |result| new(result) }
|
136
136
|
end
|
137
137
|
|
138
|
-
#Get the lists that the movie belongs to.
|
139
|
-
def self.lists(id,
|
140
|
-
search = Tmdb::Search.new("/#{
|
138
|
+
# Get the lists that the movie belongs to.
|
139
|
+
def self.lists(id, _conditions = {})
|
140
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/lists")
|
141
141
|
search.fetch_response
|
142
142
|
end
|
143
143
|
|
144
|
-
#Get the changes for a specific movie id.
|
145
|
-
#Changes are grouped by key, and ordered by date in descending order.
|
146
|
-
#By default, only the last 24 hours of changes are returned.
|
147
|
-
#The maximum number of days that can be returned in a single request is 14.
|
148
|
-
#The language is present on fields that are translatable.
|
149
|
-
def self.changes(id,
|
150
|
-
search = Tmdb::Search.new("/#{
|
144
|
+
# Get the changes for a specific movie id.
|
145
|
+
# Changes are grouped by key, and ordered by date in descending order.
|
146
|
+
# By default, only the last 24 hours of changes are returned.
|
147
|
+
# The maximum number of days that can be returned in a single request is 14.
|
148
|
+
# The language is present on fields that are translatable.
|
149
|
+
def self.changes(id, _conditions = {})
|
150
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/changes")
|
151
151
|
search.fetch_response
|
152
152
|
end
|
153
153
|
|
154
|
-
#Get the credits for a specific movie id.
|
155
|
-
def self.credits(id,
|
156
|
-
search = Tmdb::Search.new("/#{
|
154
|
+
# Get the credits for a specific movie id.
|
155
|
+
def self.credits(id, _conditions = {})
|
156
|
+
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/credits")
|
157
157
|
search.fetch_response
|
158
158
|
end
|
159
|
-
|
160
159
|
end
|
161
160
|
end
|