jellyfin / jellyfin-plugin-tmdbboxsets

https://jellyfin.org
MIT License
86 stars 20 forks source link

Error when scanning #57

Open Goblinlordx opened 2 years ago

Goblinlordx commented 2 years ago

I get the following error when scanning:

[2022-01-16 20:19:49.560 +00:00] [INF] [99] Jellyfin.Plugin.TMDbBoxSets.TMDbBoxSetManager: Box Set for "Berserk: Golden Age Arc Collection" ("118415") does not exist. Creating it now!
[2022-01-16 20:19:49.565 +00:00] [ERR] [99] Emby.Server.Implementations.ScheduledTasks.TaskManager: Error
System.IO.DirectoryNotFoundException: Could not find a part of the path '/var/lib/jellyfin/data/collections/Berserk: Golden Age Arc Collection [boxset]'.
   at System.IO.FileSystem.CreateDirectory(String fullPath)
   at System.IO.Directory.CreateDirectory(String path)
   at Emby.Server.Implementations.Collections.CollectionManager.CreateCollectionAsync(CollectionCreationOptions options)
   at Jellyfin.Plugin.TMDbBoxSets.TMDbBoxSetManager.AddMoviesToCollection(IReadOnlyCollection`1 movies, String tmdbCollectionId, BoxSet boxSet)
   at Jellyfin.Plugin.TMDbBoxSets.TMDbBoxSetManager.ScanLibrary(IProgress`1 progress)
   at Jellyfin.Plugin.TMDbBoxSets.ScheduledTasks.RefreshLibraryTask.Execute(CancellationToken cancellationToken, IProgress`1 progress)
   at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options)

I expect it is because the folder name contains an invalid character (":"). I am not sure how that is supposed to get detected or prevented. I run Jellyfin inside docker and have the folder mapped to a folder on an exfat formatted partition. The restricted characters for this format are can be found here. When creating a folder like this manually, I would get an error similar to this:

   $ mkdir "Berserk: Golden Age Arc Collection [boxset]"
mkdir: cannot create directory ‘Berserk: Golden Age Arc Collection [boxset]’: No such file or directory

This is what occurs when it contains invalid characters. Although I don't really write in C# I can probably update the implementation to filter this kind of thing. It seems like it should be an opt-in kind of thing though maybe? Not sure if there could be naming conflicts if doing it.

Edit: Actually, this seems like possibly a jellyfin issue (not plugin issue). I tried manually creating the collection and got a similar error:

[2022-01-16 20:56:22.908 +00:00] [ERR] [11] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request: "Could not find a part of the path '/var/lib/jellyfin/data/collections/Berserk: Golden Age Arc Collection [boxset]'". URL "POST" "/Collections".