Closed bluggy closed 2 years ago
This issue has been brought up a couple of times on our Discord server as well, but we're keeping the behaviour as is. Generally speaking we want to avoid people scanning their entire library accidentally. Moreover, a manual scan of an entire library can be done in the Plex UI as well.
I'm trying to perform a simple configuration as follows using
inotify
to communicate changes toplex
. Plex resides on a different machine and uses an NFS mount to access the media.However this simple configuration results in a "No target libraries found" problem. I've enabled the debug output and it appears there is discrepancy in the path between what inotify is reporting (i.e., "/media/Movies") and the path stored internally in the Plex library configuration (i.e., "/media/Movies/"). I investigated the code a bit and it appears that Autoscan is checking to see if the Plex library path is a prefix to the path reported by inotify (via the
strings.HasPrefix
function here) to determine any matching libraries. However, due to the trailing "/" in the Plex library path, this check fails, since "/media/Movies/" is not a prefix of "/media/Movies". I would have expected Autoscan to normalize the path before the comparison instead of failing in this way.When looking in the Plex User Interface, it doesn't present the path with a trailing "/", thus it likely normalizes the path itself with the trailing "/". The only work-around I've been able to think of (and which does work) is to add a "rewrite" rule to explicitly check for a missing "/" for the path and to add one as part of the rewrite. However, this doesn't seem like a scale-able solution if many paths are involved.
Am I doing something wrong here or is this just a case that was not yet encountered?