jwueller / jellyfin-plugin-onepace

Jellyfin metadata and cover art integration for the https://onepace.net/ project
https://onepace.net/
GNU General Public License v3.0
69 stars 5 forks source link

Plugin not quite getting right data for Specials #12

Closed ReinT0 closed 8 months ago

ReinT0 commented 1 year ago

It doesn't seem like it is fetching metadata for the specials folder quite correctly, some get cover arts, and some of them don't. The Gaimon April Fools special and the Strong World special don't even get episode names: log.txt https://prnt.sc/k5cslMN8p806 https://prnt.sc/RwXSxeooAgfR

The Whole Cake Island April fools special get placed in the Whole Cake Island Arc folder, while also being in the specials folder. https://prnt.sc/WGy_pSPgDPPG https://prnt.sc/RD1nDNOoX6hA

So should add a little verifyer that insures that the metadata for that folder is getting the right metadata and getting placed where it belongs. I believe your scripts searches for the episode name, and then places it in which arc it belongs. Some lines that verify that it is in the correct folder and then places it in right arc might be a good edit to the script. But as far I know this error is only for April fools special since the episode name is the same as the original.

jwueller commented 1 year ago

Thanks for typing this up again! I'm coming back from my vacation, so I will try to take a look at this sometime tomorrow.

jwueller commented 1 year ago

I managed to reproduce this locally.

jwueller commented 1 year ago

It turns out that the main cause of this is that the filenames don't match up cleanly with the API specials episode info.

Here are some filename examples:

[One Pace][0] Strong World [480p][76B2C869].mkv
[One Pace][823-824] Whole Cake Island 01 [720p][EDB72EE5].mp4
[One Pace][236-262 Covers] Wapol's Omnivorous Hurrah [720p][05BE81E6].mkv
[One Pace] Straw Hat Theatre [720p][415455AE].mkv

But these are known as Specials 01, Specials 02, etc. in the API.

This will probably have to be postponed until the API provides the CRC-32 to compare against, since that's the only unambiguous identifier for some of these filenames.

jwueller commented 1 year ago

CRC-32 filename matching is now implemented in v1.3.2.0! I'm going to wait for your feedback before I close this, if you get a chance to try it out @ReinT0.

ReinT0 commented 1 year ago

It seems like it works better with v1.3.2.0, it puts the episodes in the right places now, but it seems like it have a problem with the april fools gaimon episode, which it can't fetch any metadata for. It is put in the specials folder, but don't get any metadata.

jwueller commented 1 year ago

What is the filename for that one? Does it have a CRC-32?

jwueller commented 1 year ago

@ReinT0 Did you get the Gaimon special working?

ReinT0 commented 1 year ago

Sorry I have been busy with moving and stuff for Uni, so my server have been offline, will give you reply when I have it online and looked into the issue again.

ReinT0 commented 1 year ago

get this error when trying to update metadata:

[16:30:28] [ERR] [27] MediaBrowser.Providers.TV.EpisodeMetadataService: Error in One Pace
System.InvalidOperationException: Operation is not valid due to the current state of the object.
   at System.Text.Json.JsonElement.GetProperty(String propertyName)
   at JWueller.Jellyfin.OnePace.WebRepository.RepositoryEpisode..ctor(String arcId, JsonElement apiEpisode)
   at JWueller.Jellyfin.OnePace.WebRepository.FindEpisodeByIdAsync(String id, CancellationToken cancellationToken)
   at JWueller.Jellyfin.OnePace.EpisodeIdentifier.IdentifyAsync(IRepository repository, ItemLookupInfo itemLookupInfo, CancellationToken cancellationToken)
   at JWueller.Jellyfin.OnePace.EpisodeProvider.GetMetadata(EpisodeInfo info, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.ExecuteRemoteProviders(MetadataResult`1 temp, String logName, TIdType id, IEnumerable`1 providers, CancellationToken cancellationToken)
jwueller commented 1 year ago

Interesting, this seems to be related to the exception from the log in #28. Unfortunately that error message from System.Text.Json is pretty bad, so I will have to try to reproduce this locally to figure out how this happened.

jwueller commented 8 months ago

This should be solved in 1.4.0.0.