mynttt / UpdateTool

A tool to update the IMDB ratings for Plex libraries that contain movies/series and use the IMDB agent to receive ratings
GNU General Public License v3.0
250 stars 12 forks source link

New TV agent beta #52

Closed mrjohnpoz closed 3 years ago

mrjohnpoz commented 3 years ago

So plex now includes their new TV agent in the latest release.. 1.22.0.4136

This seems to have broken TV ratings like when they released their new Movie agent. Is there someway to get this to work, or will there be an update coming that fixes this? I sure hope so - I love my consistent and current rating using this..

I have tvdb set as ratings in the new agent.. But the few shows I have refreshed metadata on, and then ran the update tool doesn't seem to get back the imdb ratings.. Blacklist is one example. It shows a new tvdb icon and 87% as the rating..

rg9400 commented 3 years ago

I noticed this as well. Please let us know if you need any sample data to enable the logic for TV shows. The external guids appear in the exact same format as for movies, both at show and episode level. The episode guids are a bit spotty though.

mrjohnpoz commented 3 years ago

Yeah whatever info/data/logs/etc you would need just let us know.. Happy to provide whatever info is needed to get this tool to do the ratings.. They are current, they are all from same source, etc. Love this tool and would love to have it back to doing ratings for tv shows..

mynttt commented 3 years ago

Some sample data would really help here! I don't have time to set up a test library currently but with some idea of how the IDs look and a sample database I could implement support for this feature in the next days.

mrjohnpoz commented 3 years ago

what would you like exactly - just let me know and can provide it.. I have some shows that I have not refreshed the data metadata on and then some that have.., Do you need a dump of the specific set of the db. I can send you the whole db if you want. etc..

mynttt commented 3 years ago

Sending me your entire database would work pretty good! I then don't have to deal with setting up sample data its best if you send it to my mail instead of posting it here tho.

mrjohnpoz commented 3 years ago

How would be the best way to do that? Sure don't want to just post that here ;) I could post it for you to grab - or could just email it too you (what address).. Just let me know.. I take it you would just want/need com.plexapp.plugins.library.db

mynttt commented 3 years ago

Alright I've got the database. So right now it looks like Plex stores the IMDB id for some of the new items directly within the database. I'd probably release an update for that case today because it should be quick to implement.

For items that use the TVDB there won't be support until the v4 API is completly implemented. I've checked it today and it looks like it works better now it at least resolves remote ids by now. But full support for the v4 API could still take weeks because I'm busy right now and won't have much time to spare for UpdateTool at the moment.

rg9400 commented 3 years ago

Are you talking about at show level, or at episode level? At show level, if there are cases without external IMDb IDs, we can send them to Plex so they can populate them on their backend. Episode level will be very iffy, though Plex does seem to be populating the IDs in some cases.

Accuracy is high when TVDB, TMDB, and IMDb all match, but where there are discrepancies and the shows are not 1:1 on the platforms, then all bets are off. An example is Steven Universe and Steven Universe Future where there are 2 shows on TVDB/TMDB, but only a single entry on IMDb, so both matched shows would have the same IMDb ID. On the opposite hand, The Haunting is a single entry on TVDB but multiple entries on IMDb, so the IMDb ID will correspond to season 1 (The Haunting of Hill House), but the relevant show will have no second season. Finally, episode orders are flexible now, so you could end up with S01E28 even though that does not exist on IMDb.

The point with the above is just to highlight some edge cases, which we probably just have to live with. It might mean episode IDs are more accurate when available though.

mynttt commented 3 years ago

Sometimes there is only a TVDB ID available so far most of the times I've randomly looked at entries it appears that the IMDB ID is directly stored. To deal with cases where only a TVDB ID is available tho I'd need to implement the TVDB v4 API because those IDs are in the v4 format.

The reason while that will be such a big piece of work is because I'd like to keep v3 compatibility. In v3 and v4 the way that an item is adressed changes. To efficiently lookup v3 items in v4 a caching system is required and I don't have time to deal with that right now. So I'll probably try to support the v4 lookup in the next weeks and ignore the v3 backwards compatibility until v3 finally shuts down.

mrjohnpoz commented 3 years ago

Sweet! Looking forward to the update.. Yeah before - atleast where I bothered to look, and there was entries for the specific episode on imdb you would get ratings for that specific episode. I got some julie child french cooking episodes, and those never matched - because imdb doesn't have any rating for them.. which to be honest is odd ;)

Whatever you can do to get what you can working that will be great.. This is my fav tool ever for plex that is for sure.. Tautulli is slick and all - but I like what this provides more ;) Its more user facing.. And something the user would care about - the user doesn't really care about the info that tautulli provides for example. But they do like ratings ;)

rg9400 commented 3 years ago

There should also be TMDB IDs populated. I have a bunch of cases where there is no IMDb ID, but TMDB exists. Not sure if that is easier to work with compared to TVDB. I can't fault you for not wanting to touch TVDB until later on, though I do have a few with only TVDB IDs, but thankfully it isn't a ton.

mynttt commented 3 years ago

Alright with 1.5.0 it is now possible to let UpdateTool affect these new libraries as well! However this will only work for items within the library when Plex stores the IMDB ID within the local database. Fallback for TMDB/TVDB will come later when the new TVDB v4 API is implemented. As of right now there will be no log output if such a fallback ID is encountered it will simply be swallowed. This is to not spam the log with obvious information. This update is an opt-in so please read here how to whitelist libraries for it.

@mrjohnpoz Thank you for the kind words =) In your case you would have to opt-in with the library ID 6 as that's the library ID that I've seen in the database that you sent me! Let me know how it works out for you!

@rg9400 So far I've seen those TMDB IDs being in the same format as the TVDB IDs so I suspect something might have changed there as well as the old TMDB IDs where also adressed in the old TVDB format. I'll probably take a look at it when I'm doing the TVDB update.

mynttt commented 3 years ago

I'll leave this issue open until TMDB/TVDB fallback has been fully implemented!

rg9400 commented 3 years ago

I tested it, and it seems to be working as intended. I haven't checked how many cases it missed, but it seems to have populated most of my shows in Recently Added and episodes that aired at least a few days ago

mrjohnpoz commented 3 years ago

Dude you rock!!! I so added set my tv lib - your right ID 6, and the few I have checked have their imdb rating back.. Blacklist was one for sure I know use to have them and they went away after moving to the new agent.

I will go through some of the more popular shows - seems some of the early paw patrols have imdb rating back - but later ones do not.. showing tmdb ratings.. or blank..

Sure looks like a good fix to me - thank you so much! Looking at some current stuff like wandavision, blacklist, men in kilts, shameless, for all mankind - all look like they are good..

COTMO commented 3 years ago

Before switching to the new agent I made 2 test libraries with the new beta agent. One with ratings from TMDB and one TVDB. With the new update 1.5.0 it did change all the rating in both libraries perfectly. Were there isn't an IMDB rating available but the there is an TMDB or TVDB rating it leaves the rating unchanged, what is ok for me. So thanks and keep up the good job!!!

mynttt commented 3 years ago

I've separated the code for the APIs today and the current plan is to add support for TVDB v4 and TMDB v4 IDs soon.

For TVDB it will work the following way:

For TMDB it will work the following way:

mynttt commented 3 years ago

TVDB v4 is now supported and is also able to lookup old v3 IDs (which is a pretty resource intensive ring around the rosie and only got possible through an intelligent caching system). UpdateTool will automatically detecte either a v4 Pin or v3 legacy key and then choose between the two. I'll close this issue now.