plugin.video.themoviedb.helper
plugin.video.themoviedb.helper copied to clipboard
[Request] Rate movie / episode in trakt from tmdb helper context menu
Is this possible? I mean being able to do it at any time. The trakt addon only allows at the end of playback and does not always work. In fact, I don't even use it anymore. Thanks!
This shouldn't be too difficult to add. I'll look into it.
This shouldn't be too difficult to add. I'll look into it.
Thanks for considering this little feature, I actually agree in some part with the OP. The Trakt Addon's rating system sometimes gets glitchy and actually the context menu from the Addon doesn't seem to work all the time in case you wanna add or update rating in an episode or movie title.
@jurialmunkey Is there any chance for having the title of the Trakt rating context menu entry work in the same fashion as the "add to/remove from watchlist" entry? Meaning that the title of the context menu entry already indicates the current status, (on watchlist or not, or in this case if the title already has a rating and if yes which).
@jurialmunkey Is there any chance for having the title of the Trakt rating context menu entry work in the same fashion as the "add to/remove from watchlist" entry? Meaning that the title of the context menu entry already indicates the current status, (on watchlist or not, or in this case if the title already has a rating and if yes which).
@OneAngryMan
I can but it is a bit of a pain to retrieve. Need to sync all ratings for that type (e.g. all movies), then find the item in the list to get its rating. There's no way to pull the rating for a single item, so it can slow things down a bit depending on how many ratings you have and if it was the first sync.
@jurialmunkey Then it depends on how much use you see in having this feature. I just figured it would be quite handy to be able to fetch a personal trakt rating and not just push a new one. Having all the ratings cached would also pave the way for a personal trakt rating indicator in ah2, at least for tmdbh directories and widgets.
@jurialmunkey Depends on how much usage you see in having this feature. I just figured it would be quite handy to be able to fetch a personal trakt rating and not just push a new one. Having all the ratings cached would also pave the way for a personal trakt rating indicator in ah2, at least for tmdbh directories and widgets.
This was a ridiculous amount of work to achieve but it's done now in above commit.
I've likely broken other parts of Trakt sync in the process as their API is not consistent across the different sync endpoints. The latest commit attempts to wrangle it into a more consistent format that also has a bit better compatibility with TMDb.
I couldn't see anything broken from my tests but Trakt sync is used so extensively throughout the plugin that I can't possibly test every scenario. Time will tell.
It is highly likely it will take longer to access Trakt options due to the extra syncing required now to retrieve ratings. It's fine on my i7 laptop but I have no idea what the impact will be on Android, RPis and other low powered ARM chipsets.
This was a ridiculous amount of work to achieve but it's done now in above commit.
Those are indeed more changes than I had anticipated to be necessary for this feature, I sort of just figured that one could copy, paste and modify the code for the dynamic watchlist button title. This is way more extensive. Thank you for putting your time into this, it works like a charm. Additional delay is minimal on my (old Ryzen 5) notebook, unnoticeable really and I got about a thousand ratings on Trakt. One minor thing I noticed was that entering 0 as value for a new rating (says 0-10 permitted on number pad) sets 1 as new rating. 0 should either not be permitted or allow for "unrating" a title, if the Trakt api allows for that.
The commit makes it look like a bit more work than it was because I also split off some code into a separate file to make it more manageable and also write a logging function for testing purposes, but yeah way more work than expected. The refactor for sync code does have other benefits though so it was worthwhile anyway (eg made it possible to make season and episode specific watchlists).
Good to know it isn't too bad with a large rating set. The process is threaded so most AMD/Intel chipsets will handle decently. It's more on platforms like Android or low power ARM Chips that don't handle threading as well.
Weird that 0 is setting rating as 1. I'm guessing Trakt API only accepts 1-10 through "post" requests and I need to do a separate "delete" request instead of posting 0. Kind of makes sense I guess in that we're not rating as 0 but actually removing our rating.