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
84 stars 5 forks source link

Won't fetch season/arc metdata? #10

Closed ReinT0 closed 1 year ago

ReinT0 commented 1 year ago

Jellyfin can't seem to fetch metadata for the season/arc folders, it gets metadata for episodes just fine. Only the One Pace plugin is enabled for the library. I have followed the README Made clean install for jellyfin, deleted all files and made installed new image, running One Pace plugin 1.2.0.0

File structure:

/media/One Pace/
├── [One Pace][1-7] Romance Dawn [1080p]
│   ├── [One Pace][1] Romance Dawn 01 [1080p][FB72C13F].mkv
│   ├── [One Pace][2] Romance Dawn 02 [1080p][667784D2].mkv
│   ├── [One Pace][3-5] Romance Dawn 03 [1080p][F5E73C4E].mkv
│   └── [One Pace][5-7] Romance Dawn 04 [1080p][9A48E3EB].mkv
├── ...
├── ...
├── [One Pace][8-21] Orange Town [1080p]
│   ├── [One Pace][42-44] Baratie 01 [1080p][CC37D6C6].mkv
│   ├── [One Pace][45-47] Baratie 02 [1080p][FCF3D074].mkv
│   ├── [One Pace][47-49] Baratie 03 [1080p][0EB7F7E9].mkv
│   ├── [One Pace][50-52] Baratie 04 [1080p][15D77CB3].mkv
│   ├── [One Pace][53-55] Baratie 05 [1080p][6858E16A].mkv
│   └── [One Pace][56-59] Baratie 06 [1080p][757AF173].mkv
├── ...

Screenshots: https://prnt.sc/0P40frN9ZvYJ https://prnt.sc/kXp3qcvhQo9j https://prnt.sc/voULl-a-BWHw https://prnt.sc/78BYxbKVPLo8 https://prnt.sc/Q-lKGArIsldj https://prnt.sc/dAJxQ9Sreh5v

jwueller commented 1 year ago

Thank you for that information, that's very helpful!

Would you be able to upload the logs from the Jellyfin server to check for errors?

ReinT0 commented 1 year ago

log_20230701.log

this is the whole log file just search for One Pace and look through

jwueller commented 1 year ago

Thank you very much!

I can see some problems relating to identifying seasons in the logs. I will investigate this further.

jwueller commented 1 year ago

I just released a possible fix for this as v1.2.1.0. Could you give it a shot @ReinT0?

ReinT0 commented 1 year ago

log_20230702.log

I didnt have a chanche to test 1.2.1.0 before One Pace updated their API, which I believe broke the plugin again. But from what I see, so do I believe your quick fix worked before the update since it now actually numbered the season folders, before it just created "unkown" season x folders.

Schreenshots from Jellyfin: https://prnt.sc/kaALizmByh65 https://prnt.sc/7uI3RSWJawBt https://prnt.sc/8N1voS6W9orx https://prnt.sc/V5QOkVZfgTQ7

https://prnt.sc/f5WCqfzZKvK6

Link to discord message about API changes: https://discord.com/channels/229653982530764800/463509469079273482/1124932052861595698

jwueller commented 1 year ago

I just released 1.3.0.0 to deal with the new API changes. Could you give that another shot @ReinT0?

ReinT0 commented 1 year ago

log_20230702.log

After 1.3.0.0 it managed to grab metadata for episodes again. But it don't look like it manages to grab metadata for arcs, it is the same like the last screenshots, execpt episodes is now numbered named correctly. Only execption I found in naming was the April fools episodes, and that it actually creates a Specials arc folder but only places 3 out of 7 episodes in it, screenshot in last comment.

jwueller commented 1 year ago

I can see the issue in the logs, but unfortunately I can't reproduce it. I re-indexed my entire library and it came up without any errors. Did you run on a fresh library? There might have been some junk left over if you ran on a previously indexed one.

coldkick2 commented 1 year ago

I'm seeing the same on 1.3.0.0 as well - although it does partially update the metadata, not all seasons load their cover art. Orange Town - Arabasta just say Seasons 2 - 14 and don't have cover art or metadata but the episodes themselves do.

jwueller commented 1 year ago

Thank you! I will try to get to the bottom of this.

jwueller commented 1 year ago

I just published v1.3.1.0, which doesn't contain any real changes, but does a lot more logging to try to narrow down what's causing the issue.

Could I ask you both to try it out and post back your logs, since I can't reproduce the issue on my own Jellyfin instance? @ReinT0 @coldkick2

Thanks for being so patient!

ReinT0 commented 1 year ago

log.txt

I created new libraries, now with just a newly downloaded Romance Dawn arc folder in it. And also made a new library with a new pathing, getting same results. with the v1.3.1.0, but I don't quite understand the logs so

Here with whole One Pace series in new library with new path, also with "Codec Type "attachment" unknown." error, just don't bother with this, it is a jellyfin error because of the encoding with multiple languages or something, did'nt bother with deleting it for the whole thing. log 2.txt

jwueller commented 1 year ago

That's very interesting. I think I can see what the problem might be.

It seems to fail because Jellyfin is expecting one folder per series at the root of a library. So it looks into your library and finds the first folder:

/path/to/library/[One Pace][1-7] Romance Dawn [1080p]

Obviously, that's not a folder containing the entire series, but a folder specific to a season/arc. So it thinks the arc is an entire series.

Then it goes into the incorrectly identified series folder and looks for a season/arc folder. Obviously there isn't one, so it creates a dummy season/arc, and continues looking for episodes, which works again.

We can see if this is the actual problem if you create another top-level folder for One Pace in your library, so that it looks like this:

/path/to/library/One Pace/[One Pace][1-7] Romance Dawn [1080p]

It seems that your library is configured to use /One Pace/, so it probably has to look like this:

/One Pace/One Pace/[One Pace][1-7] Romance Dawn [1080p]

That way, it will (hopefully) recognize the second One Pace folder as the series, and [One Pace][1-7] Romance Dawn [1080p] as the season/arc, because Jellyfin doesn't consider the library folder itself as a series candidate.

Optimally I would make the plugin accept this case too, but I'm not sure if that's possible, since this behavior seems to be somewhat hard-coded in Jellyfin itself.

Could you try the additional folder and let me know if that changes anything?

ReinT0 commented 1 year ago

Looks like that did the trick, you should probably add that to the README.md to prevent future confusions.

One little misplacing bug, 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.

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

And if I believe correctly I rembemered the "One Pace Series" folder to get an image too, but not now: https://prnt.sc/IiOtNhatyJhI https://prnt.sc/7W78X_epO3WB https://prnt.sc/2wrPN799navL

But other than that I cant really see other "bugs" anymore

jwueller commented 1 year ago

Thank you, that's great to hear!

I'll definitely add that to the README, since it's not explicitly documented anywhere at the moment, I believe.

Concerning the series cover art, the One Pace project currently doesn't provide any cover art for the edit, so it falls back to fetching regular One Piece cover art from AniList/AniDB, if enabled. If they are enabled and you don't get anything, that's probably another bug. :smile:

The WCI/Specials thing is very interesting. It would be great if you could put up another issue for that, since it's probably a different problem. I'll close this one in the meantime, since it seems to be resolved (as soon as the README is updated).

coldkick2 commented 1 year ago

Just to note I created a separate library and have a one pace folder inside that includes all of the arcs, so mien is slightly different. I'll get logs tonight. I'm out of town

jwueller commented 1 year ago

@coldkick2 Did you get a chance to see if this is still reproducible with the current version?

jwueller commented 1 year ago

I'm going to assume that this is fixed. Please feel free to reopen or creating a new issue if something similar happens again.