Page 1 of 1

rename movie file

Posted: 17 Apr 2013, 23:01
by maortal
hey
i am using the amc.groovy and i want to know how can i rename only movies pattern
currently what i use is this
mov: tryQuietly{ movieFormat } ?: '''Movies/{n} ({y})/{fn}'''

but lately alot of movie release groups extract their movie file names to something that doesnt have much meanings so when searching for subtitles using filename its kinda difficult since its really different than the actual release name

is there anyway to create a pattern that instead of {fn} it will use {ut_title} as the new filename or something?

Re: rename movie file

Posted: 18 Apr 2013, 02:09
by rednoah
ut_title is a variable in the script NOT a binding in the format expression.

You can hard-code the ut_title value into the format string of course:

Code: Select all

'''Movies/{n} ({y})/''' + ut_title

Re: rename movie file

Posted: 18 Apr 2013, 09:44
by maortal
yeah i figured that was the problem but i didnt know how the rename function would react to that kind...

btw another thing i noticed is now the cleaner script is abit broken..
after the amc.groovy update it seems you create dirs inside dir for extraction
the problem is that the cleaner script will not delete dirs that contain empty dirs...

ex:
if i have 2 nested dirs tmpFolder1, tmpFolder2 (c:\tmpFolder1\tmpFolder2\)
both of them are empty

the cleaner will remove only tmpFolder2 and keep c:\tmpFolder1


i changed it to

args.getFolders{ it.listFiles().length <= 1 }.each { if (it.isDirectory()) clean(it) }

it seem to fixed it not sure if thats the safest way to do it but it works :)

Re: rename movie file

Posted: 18 Apr 2013, 12:32
by rednoah
cleaner.groovy fixed and commited with r1611