Need direction on script for custom filename parsing
Posted: 23 Nov 2014, 21:46
After a lot of TV scripting experiments, I've got things about right, but I'm now working on the movie collection.
I'd like to be able to do a few things, some of which may (and some of which may not) be possible - hoping for some direction!
Here's my script at this time:
{n.replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/)} ({y}){' D'+pi} [{(info.runtime)} min] {actors.take(3)} {genres.take(3)}
Quite simple compared to others; Drop leading 'The' to the rear of the title, add a year, keep the first 3 actors & genres.
But a few things I'd LIKE to do:
-keep 'DVD1', 'DVD2'... CD1, CD2 are good when a video file is split; but I only have a couple of split-main-movie DVDs, but lots of movie disc & bonus disc (ie. DVD1, DVD2...) sets.
I know from this thread http://www.filebot.net/forums/viewtopic.php?f=5&t=806 that it should be possible, but I'm unable to figure it out properly (or find a more detailed thread on this item).
-similarly to the above, I want to keep my personal choice of keywords (i.e. CE, SE, SCE, Extended Edition, etc. for DVDs) - somehow I should be able to have some script phrase exclude a check for these, or perhaps replace them with themselves if found?
OR - is it possible to have FB identify an .iso file and assume DVD vs CD from the file extension (or fileSIZE)?
-there are a handful of movies I'd like to force a 'manual' rename structure on - mostly to force a numeric word when the proper search result is alpha (i.e. I'd like '12 Monkeys' rather than 'Twelve Monkeys').
In this example, I'd like to have FB force a number check for first-word-in-the-filename (would a long .ReplaceAll string be the best way?)
In another example, 'Aeon Flux' comes up with a special character AE (I don't know the ASCII code to drop it here...) and I'd rather not have special characters... would a .ReplaceAll also be the best way??? (I'm hoping there's a way to have an ASCII check of some sort & limit suggestions to 0-9 and A-Z).
-in order to keep certain alphabetical order, I have added a numeric reference to films with sequels - i.e. 'First Blood' becomes 'Rambo 1- First Blood' so that it gets sorted with the rest of the 'Rambo' films.
Any thoughts other than the manual changes I make now? Each time I run FB on the files, I need to re-name them, of course... so some way of automating it would be great (this is the one I expect cannot be done by FB... but maybe in the future, there'd be some manual over-ride for some parts of the process?)
I'd like to be able to do a few things, some of which may (and some of which may not) be possible - hoping for some direction!
Here's my script at this time:
{n.replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/)} ({y}){' D'+pi} [{(info.runtime)} min] {actors.take(3)} {genres.take(3)}
Quite simple compared to others; Drop leading 'The' to the rear of the title, add a year, keep the first 3 actors & genres.
But a few things I'd LIKE to do:
-keep 'DVD1', 'DVD2'... CD1, CD2 are good when a video file is split; but I only have a couple of split-main-movie DVDs, but lots of movie disc & bonus disc (ie. DVD1, DVD2...) sets.
I know from this thread http://www.filebot.net/forums/viewtopic.php?f=5&t=806 that it should be possible, but I'm unable to figure it out properly (or find a more detailed thread on this item).
-similarly to the above, I want to keep my personal choice of keywords (i.e. CE, SE, SCE, Extended Edition, etc. for DVDs) - somehow I should be able to have some script phrase exclude a check for these, or perhaps replace them with themselves if found?
OR - is it possible to have FB identify an .iso file and assume DVD vs CD from the file extension (or fileSIZE)?
-there are a handful of movies I'd like to force a 'manual' rename structure on - mostly to force a numeric word when the proper search result is alpha (i.e. I'd like '12 Monkeys' rather than 'Twelve Monkeys').
In this example, I'd like to have FB force a number check for first-word-in-the-filename (would a long .ReplaceAll string be the best way?)
In another example, 'Aeon Flux' comes up with a special character AE (I don't know the ASCII code to drop it here...) and I'd rather not have special characters... would a .ReplaceAll also be the best way??? (I'm hoping there's a way to have an ASCII check of some sort & limit suggestions to 0-9 and A-Z).
-in order to keep certain alphabetical order, I have added a numeric reference to films with sequels - i.e. 'First Blood' becomes 'Rambo 1- First Blood' so that it gets sorted with the rest of the 'Rambo' films.
Any thoughts other than the manual changes I make now? Each time I run FB on the files, I need to re-name them, of course... so some way of automating it would be great (this is the one I expect cannot be done by FB... but maybe in the future, there'd be some manual over-ride for some parts of the process?)