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

TV Series rating #107

Open underlow opened 1 year ago

underlow commented 1 year ago

If you get rating updates on your episodes but not on your TV Shows, you'll have to get access to a TVDB API key. This is because the tool finds IMDB IDs that are associated with the episodes in the database, but for the TV Shows it only finds TVDB IDs that have to be resolved into IMDB IDs by calling their API. Unless you have a key, this is not possible and means that no updates are processed for these items

I do not have TVDB key and as I can see my episodes have rating when whole series do not have rating as stated in quoted text.

But if I comment that code:

    public static ImdbLibraryMetadata fetchAll(List<Library> libraries, ImdbDatabaseSupport db, ImdbPipelineConfiguration configuration) {
        var meta = new ImdbLibraryMetadata();
        for(var lib : libraries) {
            var items = db.requestEntries(lib.id, lib.type);
//            if(configuration.resolveTvdb() && lib.type == LibraryType.SERIES) {
                items.addAll(db.requestTvSeriesRoot(lib.id));
                items.addAll(db.requestTvSeasonRoot(lib.id));
//            }
            meta.metadata.put(lib.uuid, items);
        }
        return meta;
    }

everything works and I can see in logs that TV shows get their rating. Meaning it can work without TVDB key.

Can it be fixed or I'm missing something here?

mynttt commented 10 months ago

I guess that code structure is from before Plex added the IMDB ids to some entries in the database. When you comment the check out and then run it without a TVDB key in the background if those IMDB ids exist in the database they can be used with the IMDB dataset that is downloaded locally.

Shows that do not have these IDs and only provice TVDB ids would then not be resolved. I guess there is no error because at some other place the code as a fallback where the missing TVDB key is handled gracefully in these situations.

I possible option would be to add a switch to override the need of supplying a TVDB key so what you have changedin the code fragment could be configured from the outside as well.

If you're still interested in that I could add such a switch.