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

Add support for collection metadata when adding items to collection #143

Open
glensc opened this issue Apr 9, 2021 · 4 comments
Open

Add support for collection metadata when adding items to collection #143

glensc opened this issue Apr 9, 2021 · 4 comments

Comments

@glensc
Copy link
Contributor Author

glensc commented Apr 9, 2021

from what I've researched, the endpoint for this exists:

so it uses to_json from Movies:

as you can see it restricts fields that can be taken form movie object.

however, should the properties like media_type/resolution/audio/audio_channels be taken from the movie object? or parameters of add_to_library?

@glensc
Copy link
Contributor Author

glensc commented Apr 9, 2021

also, why such inconsistency? for movies all ids are passed, for tv episodes only trakt id is passed, for movies title and year are passed as well?

  • PyTrakt/trakt/movies.py

    Lines 373 to 376 in c0afea4

    def to_json(self):
    return {'movies': [dict(title=self.title,
    year=self.year,
    **self.ids)]}
  • PyTrakt/trakt/tv.py

    Lines 870 to 879 in c0afea4

    def to_json(self):
    """Return this :class:`TVEpisode` as a trakt recognizable JSON object
    """
    return {
    'episodes': [{
    'ids': {
    'trakt': self.trakt
    }
    }]
    }

@moogar0880
Copy link
Owner

It seems like the metadata needs to be applied on a per-media item basis, so I'm thinking we probably need a new type to merge the media and the metadata fields.

As for the inconsistency between the episodes and movies... I'm honestly not sure. This endpoint seems like it's changed a bit since this chunk of the code was originally written.

@glensc
Copy link
Contributor Author

glensc commented Apr 11, 2021

I'm myself submitting the metadata separately, as it's not part of the trakt media item.

As the to_json structure is not mergeable, had to rewrite whole payload on my own:

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

No branches or pull requests

2 participants