Skip to content

Commit

Permalink
Add collection image support.
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnerrp committed Aug 19, 2012
1 parent f897515 commit 0d92642
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README
Expand Up @@ -200,6 +200,8 @@ Collection:
Backdrop backdrop
Poster poster
list(Movie) members (sorted by release date)
list(Backdrop) backdrops
list(Poster) posters

Movie:
integer id
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -4,7 +4,7 @@

setup(
name='tmdb3',
version='0.6.7',
version='0.6.8',
description='TheMovieDB.org APIv3 interface',
long_description="Object-oriented interface to TheMovieDB.org's v3 API.",
packages=['tmdb3']
Expand Down
13 changes: 12 additions & 1 deletion tmdb3/tmdb_api.py
Expand Up @@ -22,7 +22,7 @@
Preliminary API specifications can be found at
http://help.themoviedb.org/kb/api/about-3"""

__version__="v0.6.7"
__version__="v0.6.8"
# 0.1.0 Initial development
# 0.2.0 Add caching mechanism for API queries
# 0.2.1 Temporary work around for broken search paging
Expand Down Expand Up @@ -50,6 +50,7 @@
# 0.6.5 Prevent data from being blanked out by subsequent queries
# 0.6.6 Turn date processing errors into mutable warnings
# 0.6.7 Add support for searching by year
# 0.6.8 Add support for collection images

from request import set_key, Request
from util import Datapoint, Datalist, Datadict, Element, NameRepr, SearchRepr
Expand Down Expand Up @@ -577,4 +578,14 @@ class Collection( NameRepr, Element ):
def _populate(self):
return Request('collection/{0}'.format(self.id), \
language=self._locale.language)
def _populate_images(self):
kwargs = {}
if not self._locale.fallthrough:
kwargs['language'] = self._locale.language
return Request('collection/{0}/images'.format(self.id), **kwargs)

backdrops = Datalist('backdrops', handler=Backdrop, \
poller=_populate_images, sort=True)
posters = Datalist('posters', handler=Poster, \
poller=_populate_images, sort=True)

0 comments on commit 0d92642

Please sign in to comment.