CommunityScripts
CommunityScripts copied to clipboard
[RenamerOnUpdate] Move files fails when library is referenced via UNC
[Symptom] Can't use RenamerOnUpdate to move files and create folder structures when library uses UNC names (ie \library\share) - at least on Windows.
[Investigation] In-situ file renames work fine. Digging around a bit (and I'm no coder for sure!) it's because the code in RenamerOnUpdate.py funtion create_new_pathis expecting a ": " in the first position, and then builds a path after that. When no ":" is present, the resulting path is \library\share\folder which then doesn't match in the DB, resulting in DB update failure and roll back.
[Fix] At least for me was to add a bool assuming path was a UNC, setting that to False if a ":" was detected, but if it remained True, then simply appending two backslashes (\ - one is needed to escape the second). While this works for me, I've done no testing beyond triggering a move based on a tag, and I've not tested against a named drive.