-
Notifications
You must be signed in to change notification settings - Fork 50
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
sync module, limited in updating watchlist / collection #132
Comments
i'm going with this for now. As I can't think of a solution where I don't have to rewrite large parts of the code. @post
def add_to_watchlist(media):
"""Add a :class:`Movie`, :class:`TVShow`, or :class:`TVEpisode`
to your watchlist
"""
# Legacy support of using PyTrakt media objects.
if isinstance(media, (TVEpisode, TVSeason, TVShow, Movie)):
media_object = media.to_json()
else:
media_object = media
yield 'sync/watchlist', media_object |
hey @p0psicles sorry about the lack of communication. I think I may have gotten overzealous when tuning my github notifications a couple months ago... but, to your questions:
It's definitely been a while since I've had the time or need to develop on this library. I'm certainly happy to review/merge PRs or provide feedback/input as needed but I don't think I'll have much in the way of time to start doing heavy development on this library, which it sounds like may be needed.
Is the extra request you're referring to a request to get the |
It comes down to requiring the TVShow().to_json() and TVEpisode().to_json() methods. I understand the initial idea behind it. But in practice it's really limiting the trakt sync api usage. What would you think of the last code example I posted? In just allowing the user to send it's own dict struct? |
I think allowing users to send their own arbitrary blobs of data should be fine. I'm not entirely sure that the class implementations should be flagged as "legacy", but the approach seems reasonable 👍 |
Ooh that's fine. I think I added the legacy comment more to show a user the old and new behavior. But I can remove the comment. I did some more changes. I'll create one big PR. That you can give your feedback on. Then I can submit one PR per functional change. Then we can take a look at the documentation. As I noticed it was lagging a bit behind. Is there a place where I can update it? |
Sounds good to me 👍
All of the docs are automatically generated from the rst files in the |
hi @moogar0880 I don't know if this project is still alive. But recently I decided to refactor some it's code, as it's kinda limited compared to what the trakt api offers.
One example is the exposure of sync/collection and sync/watchlist.
You'r only allowed to pass one TvShow, TVEpisode or Movie object to it. Where the trakt api offers a number of ways, where you can send multiple episodes, shows or movies to it. This brings some issues as for example. If you want to do batch updates of a number of episodes, you have to call the sync/ route for each episodes. Possibly resulting in rate limiting.
Now i'm able to work around this with the following code:
But then the next issue pops up.
For updating episodes, currently it's sending the following object:
But we don't have this id available when sending the request.
Now the way it's currently working, is that it will request the trakt id using the show-slug. And there are two issues i have with that.
So i'd prefer to use the forrmat of:
But this does not fit into the current architecture of PyTrakt.
An alternative i've considered. Is adding a generec sync route, that just routes and passes along the request to the route that can handle these structures of
standard media objects
The text was updated successfully, but these errors were encountered: