moogar0880 / PyTrakt

A Pythonic interface to the Trakt.tv REST API
Other
64 stars 50 forks source link

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

Open glensc opened 3 years ago

glensc commented 3 years ago

see:

api docs:

refs:

glensc commented 3 years ago

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 commented 3 years ago

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?

moogar0880 commented 3 years ago

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 commented 3 years ago

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: