IsaacJT / jellyfin-snap

Snap package for the Jellyfin media server
GNU General Public License v2.0
9 stars 1 forks source link

SMB directories #11

Open energywave opened 9 months ago

energywave commented 9 months ago

Hello, I have my media on a network attached HDD, exposed with Samba. I've mounted using CIFS the whole disk directory in /media/mediacenter and I can correctly browse there. I've added my films and other contents in subfolder inside there (/media/mediacente/film, for example) The media scan seems not to work (exits very fast...) so looking in the log it states that

[2023-12-18 01:36:58.119 +00:00] [ERR] [40] Emby.Server.Implementations.IO.LibraryMonitor: Error watching path: "/media/mediacenter/Serie TV"
System.UnauthorizedAccessException: Access to the path '/media/mediacenter/Serie TV' is denied.
 ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
   at System.IO.Directory.EnumerateDirectories(String path)
   at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
   at System.IO.FileSystemWatcher.RunningInstance..ctor(FileSystemWatcher watcher, SafeFileHandle inotifyHandle, String directoryPath, Boolean includeSubdirectories, NotifyFilters notifyFilters, CancellationToken cancellationToken)
   at System.IO.FileSystemWatcher.StartRaisingEvents()
   at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
   at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
   at Emby.Server.Implementations.IO.LibraryMonitor.<>c__DisplayClass19_0.<StartWatchingPath>b__0()

And so on for every configured folder.

I'm pretty new to snap so... I can guess it's a user/group problem? Or snap connection? What can I do to investigate?

energywave commented 9 months ago

I could manage to see mounted folders inside /media by using the following command: sudo snap connect itrue-jellyfin:removable-media So I'm now scanning my library correctly. Could not be the case to provide that connection by default on this snap?

IsaacJT commented 9 months ago

Hi @energywave

Great to hear you got it solved by connecting the interface. Unfortunately I can't get this automatically connected as it's a privileged interface and the Snap store only permits this under certain circumstances if the publisher is not the original developer of the software for security reasons (wouldn't want random software to be able to read/delete all of your /media folder ;) ).

I'm hoping to work together with the Jellyfin team on getting an official release published by them, which would mean the Snap store would allow this, so I'll leave this issue open for now.

energywave commented 9 months ago

Thank you so much for your kind explication, that makes a lot of sense, I understand. Thank you for your (appreciated!) effort!