I wrote a fancy rename scheme: http://www.filebot.net/forums/viewtopic ... 1205#p7303
Red wrote a fancy windows context menu thing: http://www.filebot.net/forums/viewtopic ... menu#p6514
And I thought "you know what? these two could totally hit it off!"
Turns out.. no.. they hate each other. Now I hate both of them, and a small piece of me has died inside because of how long I've stared at the screen trying to get this stupid thing to work. Partially because of strange characters causing encoding issues, partially because of UNC paths in a batch file causing small kittens to die, and partially because all the omg-so-many-quotes in my rename made everything cry, but all my hamster running last night didn't get me where I was trying to go :-/
However, after a great deal of trial and error, mostly error, I managed to get something that was semi-functional but still had some really weird side effects:
Code: Select all
cmd /c filebot -rename -r "%1" --db TheTVDB -non-strict --log-file context.log --format "//mynas/media/TV Shows/{norm = {it.upperInitial().lowerTrail().replaceTrailingBrackets().replaceAll(/[\`´‘’ʻ\"\"“”]/, \"'\").replaceAll(/[:|]/, \" - \").replaceAll(/[?]/, \"!\").replaceAll(/[*\\s]+/, \" \").replaceAll(/\\b[IiVvXx]+\\b/, { it.upper() }).replaceAll(/\\b[0-9](?i:th|nd|rd)\\b/, { it.lower() }).replaceFirst(/\^(?i)(The)\\s(.+)/, /\$2, \$1/)}; norm(n)}{if (norm(n) != norm(primaryTitle)) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"} ({y}{' '+any{imdb.certification}{certification}.replaceAll(/\^\\d+\$/, 'PG-\$0')})/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{norm(n)} {episode.special ? 'S00E'+special.pad(2) : s00e00} {norm(t)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|special[ ._-]edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[.]/, \" \") + ')'}{\" Part \$pi\"}{\" [\$vf \$vc \$ac \$af]\"}"
It does however 'work' consistently when applied to files with either a local or UNC path, so that's something.\\mynas\media\TV Shows\White Collar (2009 TV-14)\Season 02\White Collar S02E01 Withdrawal Part $pi [$vf $vc $ac $af].avi
Next, I tried putting the renaming scheme in a text file...
command:
Code: Select all
cmd /c for /f "delims=" %%a in (' type "C:\Program Files\FileBot\cmdlets\tv_shows.txt" ') do (filebot -rename -r "%1" --db TheTVDB -non-strict --log-file context.log --format %%a)
Code: Select all
"//mynas/media/TV Shows/{norm = {it.upperInitial().lowerTrail().replaceTrailingBrackets().replaceAll(/[\`´‘’ʻ\"\"“”]/, \"'\").replaceAll(/[:|]/, \" - \").replaceAll(/[?]/, \"!\").replaceAll(/[*\\s]+/, \" \").replaceAll(/\\b[IiVvXx]+\\b/, { it.upper() }).replaceAll(/\\b[0-9](?i:th|nd|rd)\\b/, { it.lower() }).replaceFirst(/\^(?i)(The)\\s(.+)/, /\$2, \$1/)}; norm(n)}{if (norm(n) != norm(primaryTitle)) ' ('+norm(primaryTitle)+')'}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"} ({y}{' '+any{imdb.certification}{certification}.replaceAll(/\^\\d+\$/, 'PG-\$0')})/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{norm(n)} {episode.special ? 'S00E'+special.pad(2) : s00e00} {norm(t)}{fn.contains('3D') || fn.contains('3-D') ? ' '+'3D':\"\"}{' (' + fn.matchAll(/extended|uncensored|remastered|unrated|special[ ._-]edition/)*.upperInitial()*.lowerTrail().sort().join(', ').replaceAll(/[.]/, \" \") + ')'}{\" Part \$pi\"}{\" [\$vf \$vc \$ac \$af]\"}"
I considered that a step backwards, so I decided to try encoding the txt file in unicode... however interestingly, I was back to this again:\\mynas\media\TV Shows\ (2009 TV-14)\Season 02\ S02E01 Part $pi [$vf $vc $ac $af].avi
But wait!, you say, cmd as a /u flag to say 'i'm unicode!!'... but that didn't help either\\mynas\media\TV Shows\White Collar (2009 TV-14)\Season 02\White Collar S02E01 Withdrawal Part $pi [$vf $vc $ac $af].avi
i.e. cmd /u /c for .. etc etc ... no joy
So, with the exception of something that randomly worked once and then never worked again, the closest I seem to be able to get is a file that seems to take all the $variables a little too literally.
Much to my annoyance, whenever I actually try and run the whole thing from a batch file, the success is even more limited:
command
Code: Select all
cmd /c "C:\Program Files\FileBot\cmdlets\tv_shows.bat"
Code: Select all
chcp 65001
for /f "delims=" %%a in (' type "C:\Program Files\FileBot\cmdlets\tv_shows.txt" ') do (filebot -rename -r "%1" --db TheTVDB -non-strict --log-file context.log --format %%a)
PAUSE
Code: Select all
NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
at net.sourceforge.tuned.FileUtilities.listFiles(FileUtilities.java:402)
at net.sourceforge.tuned.FileUtilities.listFiles(FileUtilities.java:407)
at net.sourceforge.tuned.FileUtilities.listFiles(FileUtilities.java:407)
at net.sourceforge.tuned.FileUtilities.listFiles(FileUtilities.java:392)
at net.sourceforge.filebot.cli.ArgumentBean.getFiles(ArgumentBean.java:161)
at net.sourceforge.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:74)
at net.sourceforge.filebot.Main.main(Main.java:192)
Failure (°_°)
... so, after about 1,000,000 revisions, and a few more greys, I'm back to basically what I had at the start with the first example, but still no closer to a solution.
AAArrrggggghhh!!!!
Any idea what would be causing it to output [$vf $vc $ac $af] instead of [360p XviD MP3 2ch]?