Closed Kjasi closed 11 months ago
Whenever a path comes in, only the first rewrite rule that matches gets applied indeed! I'm not sure whether changing the rewrite rules would be backward-compatible with existing configurations, but this is definitely something to keep in mind for a future version of Autoscan :)
How about a tag inside the rule, that makes it additive to any rule before it? By default, it would be false (backwards compatible) but if found, it applies?
This could be
radarr:
- name: radarr
priority: 2
rewrite:
- from: V:\\
to: /media/
- from: (.*?)\\
to: $1/
additive: true
This way, if I had multiple rewrites for multiple drives, they would work as before, but any (and all) additive paths are applied on top of that change?
And since this doesn't apply currently, is there any way I can go about converting from a windows path to a unix path with rewrites?
I'm running Autoscan and Jellyfin on my NAS through docker, and running Radarr and Sonarr on a separate Windows system.
This makes passing paths interesting, as Radarr will pass a windows path (
V:\\Movies\\Alphabetical\\B\\Beetlejuice (1988) [imdbid-tt0094721]
) to Autoscan.Now, I've solved most of the Windows/Unix path issues by using
While this DOES convert all the
\\
in my path to a unix friendly/
, (something I think should be in the base code of the program. Manual scan does this!) this does not fix the drive prefix for the path. My thought was (based on the documentation) I could write a second rewrite variable, which would correct for that:This should kick back
/media/Movies/Alphabetical/B/Beetlejuice (1988) [imdbid-tt0094721]
, but it doesn't. Instead, I getV:/Movies/Alphabetical/B/Beetlejuice (1988) [imdbid-tt0094721]
which looks like the second rule isn't even ran.I tried adding numerous additional variables, (
Movies
totest
,^V:\
to/media/
,A
toB
) none of which seems to activate, unless it was the first rule. If I swap my rules' order, like:This produces
/media/Movies\\Alphabetical\\B\\Beetlejuice (1988) [imdbid-tt0094721]
instead.With no combination, can I get anything but the first rewrite rule to work. Am I writing the rules wrong, or is this an issue with the program itself?