xbmc / metadata.themoviedb.org.python

Other
46 stars 41 forks source link

Add trakt ratings #9

Closed razzeee closed 4 years ago

razzeee commented 5 years ago

This is wip due to needed changes in the dependencies. But works fine with those.

I'm not really happy about us calling trakt even if ratings are not used, same goes for imdb ratings (unless you already changed that)

Will likely revisit that part.

Here is what we're waiting for https://github.com/fuzeman/trakt.py/pull/68

rmrector commented 5 years ago

I'm not really happy about us calling trakt even if ratings are not used, same goes for imdb ratings (unless you already changed that)

IMDB ratings are always used / persisted if they are added, "default" just sets the one returned when a specific source isn't named - for skins ListItem.Rating pulls up default vs ListItem.Rating(imdb) shows the IMDB rating even when TMDB is the default.

I can agree there should be on/off switches for both, though.

razzeee commented 5 years ago

I'm well aware of the data structure, was not thinking about it being nice to set both, but still, it seems pretty wasteful. And the trakt guys might not like us sending traffic there way for "no reason".

razzeee commented 4 years ago

Our dependency has been updated, I will get this into shape as soon as possible. https://github.com/fuzeman/trakt.py/releases/tag/3.1.0

razzeee commented 4 years ago

Dependency has been merged, but code seems to have been shuffled completely. Should I check if I can align it or can you do it?

rmrector commented 4 years ago

I'd prefer you give it a go - work has been heavy and it is not getting better very fast.

To set it up, move tracktratings.py to python/lib/tmdbscraper, but return a dict shaped like imdbratings.py - with no top250, "ratings" will be the only top-level key. Combine them with the original details in scraper.py with combine_scraped_details_info_and_ratings, then update the configuration to add "trakt" to the possible default_rating values.

razzeee commented 4 years ago

Updated and seems to work fine on the limited test set I have on my laptop.

razzeee commented 4 years ago

Made the suggested changes. Feel free to squash them.

rmrector commented 4 years ago

Thanks. Looks good and a quick runtime test works well here. A few unit tests are broken, but that's all still early unfinished manual stuff so I'll catch those up.

I'll have some time at the end of the month, so I'll work on minting a new version of the scraper.