Took me a while to figure out what was happening, but basically I was using path.Base() to strip off an item's parent directories. That doesn't work on paths with Windows back-slashes \. So any time we tried to update an item (movie, series) the original Windows path just had the new path prefixed to it.
The fix: Now we convert \ and / to whatever the native path separator is where Toolbarr is running. Then we can use filepath.Base() to get the last element in the path.
Took me a while to figure out what was happening, but basically I was using
path.Base()
to strip off an item's parent directories. That doesn't work on paths with Windows back-slashes\
. So any time we tried to update an item (movie, series) the original Windows path just had the new path prefixed to it.The fix: Now we convert
\
and/
to whatever the native path separator is where Toolbarr is running. Then we can usefilepath.Base()
to get the last element in the path.