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

get_watched returns watchlist instead of watchED list #160

Open
panosk75 opened this issue Oct 27, 2021 · 5 comments · May be fixed by #184
Open

get_watched returns watchlist instead of watchED list #160

panosk75 opened this issue Oct 27, 2021 · 5 comments · May be fixed by #184

Comments

@panosk75
Copy link

No description provided.

@glensc
Copy link
Contributor

glensc commented Jan 15, 2022

I've quickly thrown something together:

EDIT: closed it as per #182 (comment)

@glensc
Copy link
Contributor

glensc commented Jan 15, 2022

First, i thought to rename get_watched to watchlist to match the function body, but then I found there's get_watchlist that operates correctly:

  • PyTrakt/trakt/sync.py

    Lines 302 to 327 in 8a6d4f1

    @get
    def get_watchlist(list_type=None, sort=None):
    """
    Get a watchlist.
    optionally with a filter for a specific item type.
    :param list_type: Optional Filter by a specific type.
    Possible values: movies, shows, seasons or episodes.
    :param sort: Optional sort. Only if the type is also sent.
    Possible values: rank, added, released or title.
    """
    valid_type = ('movies', 'shows', 'seasons', 'episodes')
    valid_sort = ('rank', 'added', 'released', 'title')
    if list_type and list_type not in valid_type:
    raise ValueError('list_type must be one of {}'.format(valid_type))
    if sort and sort not in valid_sort:
    raise ValueError('sort must be one of {}'.format(valid_sort))
    uri = 'sync/watchlist'
    if list_type:
    uri += '/{}'.format(list_type)
    if list_type and sort:
    uri += '/{}'.format(sort)

for get_watched, there's a different endpoint:

should fix the logic behind it? or how to handle it api compatible way?

@glensc
Copy link
Contributor

glensc commented Jan 15, 2022

so, for 3.x, add deprecation notice:

@glensc glensc linked a pull request Jan 15, 2022 that will close this issue
@glensc
Copy link
Contributor

glensc commented Jan 15, 2022

@glensc
Copy link
Contributor

glensc commented Nov 2, 2022

so, use get_watchlist, get_watched is deprecated via #183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants