imdb-rename
imdb-rename copied to clipboard
Attempts to rename files with colon (:), not possible in windows. os error 123
Love the tool, trying to get it to loop through my media folder with a basic For loop in cmd. Works well for the most part, so thankyou!
Am running in silent mode with "echo y" prefix in a batch file. Sometimes (correctly) tries to rename to include a colon, which is not allowed in windows paths.
Possibly replace with '-', or simply a space?
On linux colons are not illegal chars, but when imdb-rename tries to rename a file containing a colon...
Thor.Ragnarok.2017.720p.mp4' to 'Thor: Ragnarok (2017).mp4'
Returns an error: Invalid argument (os error 22)
On Linux, the restriction is tied to the filesystem:
ubuntu@thinkgrunge:~$ lsblk -no name,fstype /dev/sdb1
sdb1 ntfs
ubuntu@thinkgrunge:~$ touch /media/ubuntu/Hitachi/foo:bar
touch: setting times of '/media/ubuntu/Hitachi/foo:bar': No such file or directory
It works fine on more native filesystems like tmpfs and ext4:
ubuntu@thinkgrunge:~$ touch /tmp/foo:bar ~/foo:bar
ubuntu@thinkgrunge:~$
The simplest solution is to just replace the colon with something else that won't break other matchers.
The way I get around this is I have a config file that contain character replacements:
title_tr:
":": "꞉"
"*": "∗"
"?": "﹖"
"/": "∕"
"\\": "⧵"
"|": "ǀ"
"[": "["
"]": "]"
" ": " "
let new_title = {
let mut tmp = String::from(&results[my_index].title);
for (k, v) in &CONFIG.title_tr {
tmp = tmp.replace(k, v);
}
tmp.trim().to_string()
};
How are you implementing the title changes? i know you said via a config file (config.ini)? I'm on windows and have this exact issue renaming files. Any help would be great