[Python-modules-commits] [python-tmdbsimple] 01/04: Import python-tmdbsimple_1.5.0.orig.tar.gz
Michael Fladischer
fladi at moszumanska.debian.org
Wed Jan 25 10:56:59 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch master
in repository python-tmdbsimple.
commit f5c150e72e8b56dcec5f06f02333e87bba9a8d9c
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Wed Jan 25 11:23:38 2017 +0100
Import python-tmdbsimple_1.5.0.orig.tar.gz
---
tests/test_tv.py | 6 ++++++
tmdbsimple/tv.py | 27 ++++++++++++++++++++++++---
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/tests/test_tv.py b/tests/test_tv.py
index ad93626..0898d91 100644
--- a/tests/test_tv.py
+++ b/tests/test_tv.py
@@ -82,6 +82,12 @@ class TVTestCase(unittest.TestCase):
response = tv.similar()
self.assertTrue(hasattr(tv, 'results'))
+ def test_tv_recommendations(self):
+ id = TV_ID
+ tv = tmdb.TV(id)
+ response = tv.recommendations()
+ self.assertTrue(hasattr(tv, 'results'))
+
def test_tv_translations(self):
id = TV_ID
tv = tmdb.TV(id)
diff --git a/tmdbsimple/tv.py b/tmdbsimple/tv.py
index a2e4f02..c7c6226 100644
--- a/tmdbsimple/tv.py
+++ b/tmdbsimple/tv.py
@@ -29,6 +29,7 @@ class TV(TMDB):
'images': '/{id}/images',
'rating': '/{id}/rating',
'similar': '/{id}/similar',
+ 'recommendations': '/{id}/recommendations',
'translations': '/{id}/translations',
'videos': '/{id}/videos',
'on_the_air': '/on_the_air',
@@ -138,7 +139,7 @@ class TV(TMDB):
def similar(self, **kwargs):
"""
Get the similar TV series for a specific TV series id.
-
+
Args:
page: (optional) Minimum value of 1. Expected value is an integer.
language: (optional) ISO 639-1 code.
@@ -153,6 +154,23 @@ class TV(TMDB):
self._set_attrs_to_values(response)
return response
+ def recommendations(self, **kwargs):
+ """
+ Get the recommendations for TV series for a specific TV series id.
+
+ Args:
+ page: (optional) Minimum value of 1. Expected value is an integer.
+ language: (optional) ISO 639-1 code.
+
+ Returns:
+ A dict respresentation of the JSON returned from the API.
+ """
+ path = self._get_id_path('recommendations')
+
+ response = self._GET(path, kwargs)
+ self._set_attrs_to_values(response)
+ return response
+
def translations(self, **kwargs):
"""
Get the list of translations that exist for a TV series. These
@@ -258,6 +276,7 @@ class TV(TMDB):
self._set_attrs_to_values(response)
return response
+
class TV_Seasons(TMDB):
"""
TV Seasons functionality.
@@ -267,7 +286,7 @@ class TV_Seasons(TMDB):
BASE_PATH = 'tv/{id}/season/{season_number}'
URLS = {
'info': '',
- 'credits': '/credits',
+ 'credits': '/credits',
'external_ids': '/external_ids',
'images': '/images',
'videos': '/videos',
@@ -362,6 +381,7 @@ class TV_Seasons(TMDB):
self._set_attrs_to_values(response)
return response
+
class TV_Episodes(TMDB):
"""
TV Episodes functionality.
@@ -371,7 +391,7 @@ class TV_Episodes(TMDB):
BASE_PATH = 'tv/{series_id}/season/{season_number}/episode/{episode_number}'
URLS = {
'info': '',
- 'credits': '/credits',
+ 'credits': '/credits',
'external_ids': '/external_ids',
'images': '/images',
'rating': '/rating',
@@ -489,6 +509,7 @@ class TV_Episodes(TMDB):
self._set_attrs_to_values(response)
return response
+
class Networks(TMDB):
"""
Networks functionality.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-tmdbsimple.git
More information about the Python-modules-commits
mailing list