Skip to content

Commit

Permalink
Add external id endpoint for movies (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
opensourceame authored Oct 13, 2024
1 parent 5f22a92 commit 4d2bd6b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/themoviedb/movie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Movie < Resource
# http://docs.themoviedb.apiary.io/#movies
@@fields = [
:adult,
:external_ids,
:backdrop_path,
:belongs_to_collection,
:budget,
Expand Down Expand Up @@ -99,6 +100,12 @@ def self.crew(id, _conditions = {})
search.fetch_response["crew"]
end

# Get the external ids for a specific movie id
def self.external_ids(id, _conditions = {})
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/external_ids")
search.fetch_response
end

# Get the images (posters and backdrops) for a specific movie id.
def self.images(id, _conditions = {})
search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/images")
Expand Down

0 comments on commit 4d2bd6b

Please sign in to comment.