ankenyr / jellyfin-youtube-metadata-plugin

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

Executing on all libraries despite not being enabled #58

Open wjbridge opened 2 years ago

wjbridge commented 2 years ago

For some reason, this plugin is executing on all my libraries. I do not have any of the YoutubeMetadata boxes checked in any of these libraries. Is this expected behavior? Kind of confused about why it is running in these libraries.

Jellyfin Version: 10.8

TV Shows

[14:43:46] [ERR] [69] MediaBrowser.Providers.TV.EpisodeMetadataService: Error in YoutubeMetadata
System.IO.FileNotFoundException: Could not find file '/tvshows/The Big Bang Theory/Season 02/The Big Bang Theory S02E13 [Bluray-1080p Remux][DTS-HD MA 5.1][AVC].info.json'.
File name: '/tvshows/The Big Bang Theory/Season 02/The Big Bang Theory S02E13 [Bluray-1080p Remux][DTS-HD MA 5.1][AVC].info.json'
   at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding)
   at Jellyfin.Plugin.YoutubeMetadata.Providers.AbstractYoutubeLocalProvider`2.GetMetadata(ItemInfo info, IDirectoryService directoryService, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.RefreshWithProviders(MetadataResult`1 metadata, TIdType id, MetadataRefreshOptions options, ICollection`1 providers, ItemImageProvider imageService, CancellationToken cancellationToken)

Anime

[14:39:05] [ERR] [22] MediaBrowser.Providers.TV.EpisodeMetadataService: Error in YoutubeMetadata
System.IO.FileNotFoundException: Could not find file '/anime/Hundred/Season 01/Hundred - S01E08 - Night at the Lake.info.json'.
File name: '/anime/Hundred/Season 01/Hundred - S01E08 - Night at the Lake.info.json'
   at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding)
   at Jellyfin.Plugin.YoutubeMetadata.Providers.AbstractYoutubeLocalProvider`2.GetMetadata(ItemInfo info, IDirectoryService directoryService, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.RefreshWithProviders(MetadataResult`1 metadata, TIdType id, MetadataRefreshOptions options, ICollection`1 providers, ItemImageProvider imageService, CancellationToken cancellationToken)
ankenyr commented 2 years ago

It shouldn't, I have multiple libraries many of which do not use this plugin. Did you at one point enable it?

wjbridge commented 2 years ago

I did not enable it for any of these libraries as shown. I am not sure though behavior-wise if a library already exists and you install the plugin, does it automatically enable itself for the existing libraries?

Another note, @ankenyr...wanted to say also an awesome plugin! I am trying to move to Jellyfin from Plex but need certain functions to work before the move :)

ankenyr commented 2 years ago

Thanks for the kind words. I moved away from Plex myself and this was the bare minimum I needed to do so.

So my understanding of how things work in the metadata collection is it loops over all the enabled metadata providers for any given library for each media type. If something is disabled it shouldn't ever drop into my plugin which it obviously is in this case.

Search in your Jellyfin data directory for a file named options.xml which should be located in a folder named root/default/<name of library> or something similar. The xml file should contain all the library options. If you can find that please copy/paste it here or upload it. It will show the path to your library and other things that may or may not be sensitive. Feel free to abstract those. I am looking to see if the config is different from what the UI is showing.

wjbridge commented 2 years ago

Sorry about the delay. I have attached the options for my Anime library and the Youtube library lib_options.zip

Fribb commented 1 year ago

I have the same issue with my Movie Library while trying out Jellyfin.

I added the Youtube Plugin to the server and added it to the Youtube library. When I now want to add a Movie library, the Plugin is listed as Metadata readers, Metadata Downloaders and Image fetchers.

It is disabled in my downloaders and image fetchers but I cannot disable it on the metadata readers.

While I don't have experience with how Jellyfin works my assumption would be that the Metadata Reader is the culprit here? In the log file, it says that it cannot find the info.json which is the locally stored file which seems to be the same as the NFO listed under Metadata Readers.

Maybe Jellyfin is executing the Plugins to read locally stored metadata? This could mean that the NFO is failing silently while the Plugin is throwing the FileNotFound Exception.

ZippierOstrich1 commented 1 year ago

I got the same problem in my tv show library. Same error and settings. Jellyfin version is 10.8.4 installed via docker. Plugin version 1.0.3.9. If there's a need for more infos I can provide them. Thank you for your work.

nothing2obvi commented 1 year ago

I have this same issue. I see it run on my TV shows library. In "Manage Library" it is unchecked for "Metadata downloaders" and "Image fetchers," and I also set the "Metadata readers" section at the very top with NFO above YoutubeMetadata.

Jellyfin: 10.8.9 Youtube Metadata Plugin: 1.0.3.9