SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

sanitize filenames during correct-from-tags

I’ve been using Jaikoz’s “correct filename/foldername from tags” feature to clean up a ton of old mis-tagged and mis-named music files, and it’s generally awesome. There’s Just One Thing…

I run a mixed MacOS and Linux environment at home, and that comes with some weird tradeoffs. Under linux, “/” is a directory separator, and you can’t ever use it in a filename. Under MacOS, the same is true of “:”. Presumably if I were to throw Windows into the mix, I’d have similar problems with “\”.

Right now, it looks like Jaikoz just silently discards impossible characters from file and folder names when it tries to save files or folders. That’s a good default, but I’d love to be able to set up something like the word replacer manipulator, but for filenames instead of tags. e.g. in my circumstance, I’d have a filter that replaced / with \, and replaced : with -. Then for bonus points I’d replace " " with “_”, because http servers do ugly things to filenames with spaces in them. :slight_smile:

Would this be difficult to implement?

[quote=dr_memory]I’ve been using Jaikoz’s “correct filename/foldername from tags” feature to clean up a ton of old mis-tagged and mis-named music files, and it’s generally awesome. There’s Just One Thing…

I run a mixed MacOS and Linux environment at home, and that comes with some weird tradeoffs. Under linux, “/” is a directory separator, and you can’t ever use it in a filename. Under MacOS, the same is true of “:”. Presumably if I were to throw Windows into the mix, I’d have similar problems with “\”.
[/quote]
Actually its more complicated than that. MacOS is based on UNIX and actually uses “/” as directory seperator like inb Linux. But from the Finder ‘/’ are shown as ‘:’ , if you actually create a filename in the Finder with a ‘/’ in it it actually stores it as a ‘:’. You can see this by opening a Terminal Window and looking athe file from there.

Jaikoz shows the underlying unix filename, you can see this by viewing the base Folder and Sub Folder columns, you’ll see folders are seperated by a ‘/’.

To avoid confusion Jaikoz removes ‘/’ and ‘:’ from filenames.

[quote=dr_memory]
Right now, it looks like Jaikoz just silently discards impossible characters from file and folder names when it tries to save files or folders. That’s a good default, but I’d love to be able to set up something like the word replacer manipulator, but for filenames instead of tags. e.g. in my circumstance, I’d have a filter that replaced / with \, and replaced : with -. Then for bonus points I’d replace " " with “_”, because http servers do ugly things to filenames with spaces in them. :slight_smile:
Would this be difficult to implement?[/quote]
What you can do now, is :
Start the Find and Replace
Enter a space char in the Find field
Enter _ in the Replace field
Change the first drop down to contain the Filename column
Click on ‘Replace All’