ankenyr / jellyfin-youtube-metadata-plugin

Youtube Metadata Plugin for Jellyfin
GNU Affero General Public License v3.0
486 stars 31 forks source link

All seasons changed to a single season #37

Closed NotExpectedYet closed 2 years ago

NotExpectedYet commented 2 years ago

Hello, I just updated yesterday whilst trying out 10.8.0 and now some of my shows have decided to all get lumped into a single season.

image

Which as you can expect is taking ages to load into the episode list. They use to be split by year following my folder structure.

Just wondering if it's the plugin or some change in JellyFin as I've currently no idea. If it is your plugin, any chance to have this option able to toggle?

image

Oh and big thanks for the recent improvements and fixing that sorting order in the UI :D

ankenyr commented 2 years ago

Yea when originally coming up with this new version I kept things simple since i was learning a lot and changing a bunch. I recently found out about a task that can be triggered to launch after library scan so I will be making some new improvements this week.

That being said for seasons, I made it one for simplicity. I don't store my videos in year folders. I use https://github.com/TheFrenchGhosty/TheFrenchGhostys-Ultimate-YouTube-DL-Scripts-Collection

There are no seasons to a Youtube Channel so trying to figure out a season structure was not obvious to me. Normally its done from the folder names IIRC.

Would seasons by year, seasons capped at X episodes, or seasons by year-month or some other strategy make sense to you or others reading this? These would likely need to be library wide at first until I think of a better way of handling it.

NotExpectedYet commented 2 years ago

Yea when originally coming up with this new version I kept things simple since i was learning a lot and changing a bunch. I recently found out about a task that can be triggered to launch after library scan so I will be making some new improvements this week.

That being said for seasons, I made it one for simplicity. I don't store my videos in year folders. I use https://github.com/TheFrenchGhosty/TheFrenchGhostys-Ultimate-YouTube-DL-Scripts-Collection

There are no seasons to a Youtube Channel so trying to figure out a season structure was not obvious to me. Normally its done from the folder names IIRC.

Would seasons by year, seasons capped at X episodes, or seasons by year-month or some other strategy make sense to you or others reading this? These would likely need to be library wide at first until I think of a better way of handling it.

No trouble thanks for the explanation. Season by year was what I settled on after messing with storing youtube videos for a while with Plex. As you said, there aren't season on every channel, and the upload (release) date is the only thing consistent on every video. I'd actually forgotten we could name shows like $SHOWNAME/%(upload_date>%Y)s/$SHOWNAME - %(upload_date>%Y-%m-%d)s - %(title)s and was glad to see it still supported in Jellyfin.

If possible respecting whatever people have their folder structure setup would be the best IMO but the options seem fine to me, year-month would be cool for that channel though aha! I'll wait and see what others chime in with.

ankenyr commented 2 years ago

This should now be fixed in https://github.com/ankenyr/jellyfin-youtube-metadata-plugin/commit/8938a55e5cf8763fbbd12d20b519ecc91120f6de

Will add documentation shortly.

ankenyr commented 2 years ago

Also a release...haha

NotExpectedYet commented 2 years ago

Epic thanks! I've just managed to wangle the ID back into my file names and sorted a docker with youtube-dlp included so will give it a try once I spot the release :D.

Edit: Spotted the release, will scan and see what happens

I had some other issues, like I've a mixed library of some stuff called Lectures. It's sourced from all over and some stuff is youtube, others has no online source. It seems to be falling back and grabbing by show name maybe? I'll have a proper check through once I've tried this latest version. Don't think it's really your plugins fault, I gather you expect a library full of yt-dlp stuff which is a fair assumption to make.

The ID match regex seems to only support youtube content as well, it falls back to my local content fine though. Just wanted to mention, encase you'd planned something for them. Anyway, I'll test more and report back :) Do love the work already, your scripts found some way better poster art than I did with google fu for my channels!

NotExpectedYet commented 2 years ago

Keep seeing these too but it's only on the channels I mentioned above. It's probably my fault leaving them without art.

today at 06:03:48[06:03:48] [ERR] [21] MediaBrowser.Providers.Manager.ProviderManager: YTDLSeriesImageProvider failed in GetImageInfos for type Series at /media/Videos/Lectures/Evolution and Medicine _  Stephen C. Stearns
today at 06:03:48System.IO.DirectoryNotFoundException: Could not find a part of the path '/cache/youtubemetadata/Evolution and Medicine _  Stephen C. Stearns/ytvideo.info.json'.
today at 06:03:48   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
today at 06:03:48   at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
today at 06:03:48   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
today at 06:03:48   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
today at 06:03:48   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
today at 06:03:48   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
today at 06:03:48   at System.IO.File.InternalReadAllText(String path, Encoding encoding)
today at 06:03:48   at Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeDL.YTDLSeriesImageProvider.GetImages(BaseItem item, CancellationToken cancellationToken)
today at 06:03:48   at MediaBrowser.Providers.Manager.ProviderManager.GetImages(BaseItem item, IRemoteImageProvider provider, String preferredLanguage, Boolean includeAllLanguages, CancellationToken cancellationToken, Nullable`1 type)
NotExpectedYet commented 2 years ago

Infact, some of those are correct! No ID, no local json file. xD.

If the channel name is a person it finds that on youtube nicely. That's acceptable and a nice fall back, I was planning on organising all those by speaker anyway.

ankenyr commented 2 years ago

Epic thanks! I've just managed to wangle the ID back into my file names and sorted a docker with youtube-dlp included so will give it a try once I spot the release :D. Thanks! I am going to do some work to see how searching via yt-dlp works with episodes. I want to make a quick script in python to take every video and do a search for its name and compare the resulting ID found and see what the accuracy would be realistically. If it is high enough I will likely add an option to try and use that instead of the ID if it is not available.

I had some other issues, like I've a mixed library of some stuff called Lectures. Yea in my case I am kinda expecting the library to be YT content but if an info.json file is not found it shouldn't do anything besides fail.

Do love the work already, your scripts found some way better poster art than I did with google fu for my channels! Thanks so much! You have no idea how much I appreciate the kind words!

NotExpectedYet commented 2 years ago

Thanks! I am going to do some work to see how searching via yt-dlp works with episodes. I want to make a quick script in python to take every video and do a search for its name and compare the resulting ID found and see what the accuracy would be realistically. If it is high enough I will likely add an option to try and use that instead of the ID if it is not available.

Be interested to see that myself. I haven't noticed anything incorrect so far. What version of Jellyfin do you use out of curiosity? I've built mine from unstable currently. Does the scanner like, pause and then start for you? Dunno if it's just processing all it previously did.

Yea in my case I am kinda expecting the library to be YT content but if an info.json file is not found it shouldn't do anything besides fail.

Totally fine, although mine aren't failing aha. There's a screenshot below. There's maybe 2 channels in there that have id's or .json files the rest we're all blank with just the initial .nfo Jellyfin created. The logs just state:

today at 07:01:12[07:01:12] [INF] [45] Jellyfin.Plugin.YoutubeMetadata.Providers.YTDLEpisodeProvider: Youtube ID not found in filename of title: {info.Name}
today at 07:01:12[07:01:12] [INF] [45] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeDL.YTDLImageProvider: Youtube ID not found in filename of title: {item.Name}

image

Thanks so much! You have no idea how much I appreciate the kind words!

I'd donate if I had any spare cash this month... christmas! ahaha. You've super charged my library and unintended done the work on my lectures library I couldn't be bothered to do XD.

NotExpectedYet commented 2 years ago

Also sorry for just spamming this ticket, didn't see discussion enabled.

ankenyr commented 2 years ago

Don't worry about it!

I use a docker container based on the linuxserver.io built on 2022-01-04. So what ever version that is, it should be at least 10.8.

Does the scanner like, pause and then start for you?

Do you mean that it starts and you see the "Scan Media Library" with a percentage and it goes up then kinda stalls for a minute and then starts up again? If so then yea. I believe this is an error with ffprobe. I asked about it on the jellyfin element channels It sounds like this is fixed but has yet to be merged.

Totally fine, although mine aren't failing aha. There's a screenshot below. There's maybe 2 channels in there that have id's or .json files the rest we're all blank with just the initial .nfo Jellyfin created. The logs just state: Do you have other metadata agents enabled or nof files for those videos?

I'd donate if I had any spare cash this month... Understandable and don't worry. Take care of yourself and your family before buying me a coffee/beer.

NotExpectedYet commented 2 years ago

Good to know thanks! I'll see how bleeding edge fairs for me aha.

Do you mean that it starts and you see the "Scan Media Library" with a percentage and it goes up then kinda stalls for a minute and then starts up again? If so then yea. I believe this is an error with ffprobe. I asked about it on the jellyfin element channels It sounds like this is fixed but has yet to be merged.

Sorry it's when I force update the specific library, but it's same as a library scan regardless. Exactly that though, good to know as well.