Permalink
Browse files

Add method to search for movies similar to current.

  • Loading branch information...
wagnerrp committed May 3, 2012
1 parent 676cbb1 commit 30a0d398cc5f40487a69ddcc3beff77b09052def
Showing with 12 additions and 3 deletions.
  1. +2 −1 README
  2. +1 −1 setup.py
  3. +9 −1 tmdb3/tmdb_api.py
View
3 README
@@ -170,7 +170,7 @@ trailers offer multiple sizes.
## List of Available Data
type name
type name
Collection:
integer id
@@ -210,6 +210,7 @@ Movie:
list(Keyword) keywords
dict(Release) releases (indexed by country)
list(Translation) translations
list(Movie) getSimilar()
Movie classmethods
Movie fromIMDB(imdbid) special constructor for use with IMDb codes
View
@@ -4,7 +4,7 @@
setup(
name='tmdb3',
version='0.6.1',
version='0.6.2',
description='TheMovieDB.org APIv3 interface',
long_description="Object-oriented interface to TheMovieDB.org's v3 API.",
packages=['tmdb3']
View
@@ -22,7 +22,7 @@
Preliminary API specifications can be found at
http://help.themoviedb.org/kb/api/about-3"""
__version__="v0.6.1"
__version__="v0.6.2"
# 0.1.0 Initial development
# 0.2.0 Add caching mechanism for API queries
# 0.2.1 Temporary work around for broken search paging
@@ -44,6 +44,7 @@
# 0.5.0 Rework cache framework and improve file cache performance
# 0.6.0 Add user authentication support
# 0.6.1 Add adult filtering for people searches
# 0.6.2 Add similar movie search for Movie objects
from request import set_key, Request
from util import Datapoint, Datalist, Datadict, Element, NameRepr, SearchRepr
@@ -460,6 +461,13 @@ def setRating(self, value):
req.add_data({'value':value})
req.readJSON()
def getSimilar(self):
res = MovieSearchResult(Request('movie/{0}/similar_movies'\
.format(self.id)),
locale=self._locale)
res._name = 'Similar to {0}'.format(self._printable_name())
return res
def _printable_name(self):
if self.title is not None:
s = u"'{0}'".format(self.title)

0 comments on commit 30a0d39

Please sign in to comment.