2012-10-22 08:31:15 -04:00
|
|
|
// filebot -script fn:renall <options> <folder> --def target=[file|folder]
|
2011-11-02 08:21:09 -04:00
|
|
|
|
|
|
|
/*
|
2012-10-22 08:31:15 -04:00
|
|
|
* Rename all tv shows, anime or movies folder by folder using given or default options.
|
2011-11-02 08:21:09 -04:00
|
|
|
*/
|
2012-10-22 08:31:15 -04:00
|
|
|
def target = tryQuietly{ target } ?: 'file' // target files by default
|
|
|
|
|
|
|
|
args.eachMediaFolder {
|
|
|
|
switch(target) {
|
|
|
|
case 'file' : return rename(folder:it) // rename files within each folder
|
|
|
|
case 'folder' : return rename(file :it) // rename folders as if they were files
|
|
|
|
}
|
2011-11-02 08:21:09 -04:00
|
|
|
}
|