Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

jellyfin: No target libraries found / failed determining library #237

Open
domi-a opened this issue Jun 16, 2024 · 0 comments
Open

jellyfin: No target libraries found / failed determining library #237

domi-a opened this issue Jun 16, 2024 · 0 comments

Comments

@domi-a
Copy link

domi-a commented Jun 16, 2024

hi,

wonderful work. discovered this app yesterday and got it running in a couple of minutes. thanks!

i know there are a lot of issues with this error message. but i thinkered the whole day and am pretty sure, that this is a bug.

i don't need rewrite rules as my paths for autoscan and jellyfin are exact the same.
everytime i make changes to the filesysem, it can't match it to my jellyfin library.
WRN No target libraries found error="/mnt/video_temp/movies: failed determining library" target=jellyfin url=http://10.13.13.11:8096

it seems like this line does not make any sense:

if strings.HasPrefix(folder, l.Path) {

it never matches my paths.
but looking in
if len(libPath) > 0 && libPath[len(libPath)-1] != '/' {
the library path always get suffixed with a slash, while the fs changes always come without a trailing slash!

i did not manage to debug this code, but it seems to compare every 'folder' without a slash suffix to a 'l.Path' with a slash suffix. which never matches and does not send updates to jellyfin. so the HasPrefix method seems not appropiate.

  • i checked the api calls of jellyfn -> all paths return with a slash
  • i send manually posts to jellyfin -> works fine
  • i checked out autoscan:1.2.0 as the first version with jellyfin target. bug is already there
  • i got the build running locally and made this exact change, but in jellyfin target Plex library failed determining if using "Stand-Alone Movie Files"-structure #183 (comment) , that fixes the issue
  • maybe it only occurs in a special setup (mine is simple ext4 fs, running autoscan in docker)
  • it does not only occur in plain movie structure - it occurs in all direct changes like added or removed folders as well

for everyone who needs a immediate fix:

  • while writing this issue i figured out that the workaround would be:
  • using a target rewrite - trigger rewrite does not help at all
    • from: ^/mnt/video_temp/movies
      to: /mnt/video_temp/movies/

i would suggest not relying on must have target rewrite rules.
and the real fix would be not much work and should not harm any other bad behavior.

while looking at the code i have the feeling it may affect other target systems like plex as well. maybe it would be a good idea to not suffix the read lines from the system with a slash or suffixing every path from fs changes with a trailing slash.

sry for the poor analysis, i did never read any go code before this day.

best regards, domi

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@domi-a and others