I have my data split across three different paths (NAS), and I try to keep efficient, and organized.
I have come up with a formatting pattern that would:
* Check if the media that should be renamed is alread present in one of the three possible locations
* If the media is not present, the script should pick up the location that has more space available at the time of the move
Groovy: Select all
{["/path_1", "path_2", "path_3"]
.collect{"$it/Shared Videos/Serie TV/$n" as File}
.sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }
.last()
}/{"Season "+s}/{n} - {s00e00} - {t}{'.'+lang.ISO2}
Is there any method that I can use to sanitize the expected name already when renaming the pattern?