ShokoAnime / Shokofin

Repository for Shokofin, a plugin that brings Shoko to Jellyfin.
https://shokoanime.com
MIT License
145 stars 17 forks source link

Change ProviderId functions and potentially fix the series splitting because of it #63

Closed EraYaN closed 3 months ago

EraYaN commented 3 months ago

Fixes #62 (hopefully)

So I'll run this for a little bit on my server and if it sticks, I'll comment here. Not sure what about this fixes it but probably the extra check in IdLookup.cs.

I also bumped the dependencies.

EDIT: Alright this does not fix it, the series are merged but now all the Series entities have no seasons. And Episode data is still messed up after a scan, that is probably why they are no showing up. Season names also change from "Season 1" to the actual Shoko show name on the second scan. It also sets the SeriesId and Shoko Provider id of the first show in a group to all shows in said group.

EraYaN commented 3 months ago

Sadly the changes did not fix it, the shows still split up. They do all have seasons now though. But the original problem returned, PresentationUniqueKey gets reset, because the Custom provider ID is gone.

Edit these logs lines seem to be the culprit:

[2024-07-14 13:40:33.621 +00:00] [DBG] [37] MediaBrowser.Providers.Manager.ProviderManager: OnRefreshProgress 29496f90814ef1e9e07d4f009f2e72b7 50
[2024-07-14 13:40:33.634 +00:00] [DBG] [29] Shokofin.Sync.UserDataSyncManager: TODO; "Import" user data for Series "Series 1". (Series="1")
[2024-07-14 13:40:33.635 +00:00] [INF] [29] MediaBrowser.Providers.TV.SeriesMetadataService: Removing virtual season 1 in series "Series 1"
[2024-07-14 13:40:33.635 +00:00] [INF] [29] Emby.Server.Implementations.Library.LibraryManager: Removing item, Type: "Season", Name: "Series 1", Path: "", Id: 5fa6cdfb-72ea-e759-b411-e408331ad56b
[2024-07-14 13:40:33.636 +00:00] [DBG] [29] Emby.Server.Implementations.Library.LibraryManager: Deleting metadata path, Type: "Season", Name: "Series 1", Path: "/config/metadata/library/5f/5fa6cdfb72eae759b411e408331ad56b", Id: 5fa6cdfb-72ea-e759-b411-e408331ad56b
[2024-07-14 13:40:33.636 +00:00] [DBG] [37] Shokofin.Sync.UserDataSyncManager: TODO; "Import" user data for Series "Series 1". (Series="1")
[2024-07-14 13:40:33.637 +00:00] [INF] [37] MediaBrowser.Providers.TV.SeriesMetadataService: Removing virtual season 3 in series "Series 1"
[2024-07-14 13:40:33.637 +00:00] [INF] [37] Emby.Server.Implementations.Library.LibraryManager: Removing item, Type: "Season", Name: "Series 2", Path: "", Id: 8853c5b1-a6d3-4df6-814c-99694b1aee66
[2024-07-14 13:40:33.637 +00:00] [DBG] [37] Emby.Server.Implementations.Library.LibraryManager: Deleting metadata path, Type: "Season", Name: "Series 2", Path: "/config/metadata/library/88/8853c5b1a6d34df6814c99694b1aee66", Id: 8853c5b1-a6d3-4df6-814c-99694b1aee66
[2024-07-14 13:40:33.639 +00:00] [DBG] [23] MediaBrowser.Providers.Manager.ProviderManager: OnRefreshProgress 29496f90814ef1e9e07d4f009f2e72b7 52
revam commented 3 months ago

The lookup class isn't, and shouldn't be, used to set the custom ID. It shouldn't even be aware of the ID's existence. Only the series provider will, and should, set the ID. As the ID is used solely for series merging within the plugin and nothing more.

Now, I can try to dig further to see if the id is unset somewhere, or if we're using the presentation unique key too early in the plugin, custom providers, etc. leading to it being cached earlier than expected, etc.

revam commented 3 months ago

This didn't fix what it initially was made for, but since it does contain changes that we want then I'll still merge it.