Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added get histroy #35

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ nosetests.xml

# Virtual environments
venv
*.log
*.json
9Mad-Max5 marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 16 additions & 2 deletions trakt/tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__all__ = ['dismiss_recommendation', 'get_recommended_shows', 'genres',
'popular_shows', 'trending_shows', 'updated_shows',
'recommended_shows', 'played_shows', 'watched_shows',
'collected_shows', 'anticipated_shows', 'TVShow', 'TVEpisode',
'collected_shows', 'anticipated_shows', 'studios', 'TVShow', 'TVEpisode',
'TVSeason', 'Translation']


Expand Down Expand Up @@ -201,6 +201,20 @@ def anticipated_shows(page=1, limit=10, extended=None):
data = yield uri
yield [TVShow(**show['show']) for show in data]

@get
def studios(tvshow):
"""
Check :class:`TVShow`' for published studios
as well the title can be passed directly.
"""
if isinstance(tvshow, TVShow):
title = tvshow.slug

uri = f'shows/{title}/studios'

data = yield uri
yield data


class TVShow(IdsMixin):
"""A Class representing a TV Show object."""
Expand Down Expand Up @@ -341,7 +355,7 @@ def progress(self):
The next_episode will be the next episode the user should collect,
if there are no upcoming episodes it will be set to null.
"""
return self._progress('collection')
return self._progress('watched')

@get
def collection_progress(self, **kwargs):
Expand Down