tubearchivist / tubearchivist-jf-plugin

Metadata for your TubeArchivist library on Jellyfin.
GNU General Public License v3.0
126 stars 6 forks source link

[Bug]: Plugin causes Jellyfin to crash when scanning series #25

Open wolffshots opened 3 days ago

wolffshots commented 3 days ago

I've read the documentation

Operating System

Linux

Your Bug Report

Describe the bug

When scanning libraries the OnWatchedStatusChange is fired when scanning my normal Series library which causes this line to crash the Jellyfin server:

itemYTId = Utils.GetVideoNameFromPath(eventArgs.Item.Path);

I have specifically disabled the TubeArchvist plugin for the Series library but the issue persists unless I disable the plugin.

Steps To Reproduce

Expected behavior

Relevant Jellyfin log output

System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source, Func`2 predicate)
   at Jellyfin.Plugin.TubeArchivistMetadata.Utilities.Utils.DetectDirectorySeparator(String path)
   at Jellyfin.Plugin.TubeArchivistMetadata.Utilities.Utils.GetVideoNameFromPath(String path)
   at Jellyfin.Plugin.TubeArchivistMetadata.Plugin.OnWatchedStatusChange(Object sender, UserDataSaveEventArgs eventArgs)

Anything else?

I've got a fork with a workaround here that I have been testing that I will open a PR for soon once I have made a branch for the specific fix.

DarkFighterLuke commented 2 days ago

Are you sure you don't have enabled TubeArchivist plugin on the wrong collections? I can't reproduce the issue you face

wolffshots commented 2 days ago

Yeah I'm 100% sure I don't have it enabled on my normal Series collection and it's not an option on any other collections. Any other ideas what could be causing this?

It seems to happen every time I run a scan on my Series collection but the other seem to work fine (including the TA collection)