I've been attempting to research and put together two scripts: one to re-sort and distribute my current library across the (currently) 4 separate NAS destinations, then another to maintain that organization.
To start with, I believe I need to customize this code snippet:
Code: Select all
{['C:', 'D:', 'E:'].collect{ (it+'/TV/'+n) as File }.sort{ a, b, c, d -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace <=> c.diskSpace <=> d.diskSpace }.last()}/{episode}
This format will always evaluate to a path to the drive with the most free space, unless the series folder already exists on one of the drives in which case it'll prefer the existing one.
If my understanding is correct, I'd need to make that into several chunks, one for each media type ie:
Code: Select all
{['W:', 'X:', 'Y:', 'Z:'].collect{ (it+'/TV_Series/'+n) as File }.sort{ a, b, c, d -> a.exists() <=> b.exists() <=> c.exists() <=> d.exists()?: a.diskSpace <=> b.diskSpace <=> c.diskSpace <=> d.diskSpace }.last()}/{episode}
Code: Select all
{['W:', 'X:', 'Y:', 'Z:'].collect{ (it+'/Music/'+n) as File }.sort{ a, b,c, d -> a.exists() <=> b.exists() <=> c.exists() <=> d.exists()?: a.diskSpace <=> b.diskSpace <=> c.diskSpace <=> d.diskSpace }.last()}/{episode}
Code: Select all
{['W:', 'X:', 'Y:', 'Z:'].collect{ (it+'/Movies/'+n) as File }.sort{ a, b, c, d -> a.exists() <=> b.exists() <=> c.exists() <=> d.exists()?: a.diskSpace <=> b.diskSpace <=> c.diskSpace <=> d.diskSpace }.last()}/Movies/{n} ({y})/{n} ({y})
Code: Select all
{['W:', 'X:', 'Y:', 'Z:'].collect{ (it+'/Documentary_Movies/'+n) as File }.sort{ a, b, c, d -> a.exists() <=> b.exists() <=> c.exists() <=> d.exists()?: a.diskSpace <=> b.diskSpace <=> c.diskSpace <=> d.diskSpace }.last()}/Movies/{n} ({y})/{n} ({y})
Code: Select all
{['W:', 'X:', 'Y:', 'Z:'].collect{ (it+'/Documentary_Series/'+n) as File }.sort{ a, b, c, d -> a.exists() <=> b.exists() <=> c.exists() <=> d.exists()?: a.diskSpace <=> b.diskSpace <=> c.diskSpace <=> d.diskSpace }.last()}/{episode}
Am I correct thus far?
EDIT: I just realized something: these snippets (if they're correct) would be great for the 2nd part, managing the files & folders after the re-organisation has been executed properly. It doesn't 'look' like they'd be effective for the initial re-sort.
Let me put in a little detail of what I have & what I want, then hopefully it'll be clearer and easier to get help

I've four 2-bay NAS units consisting of 2 pairs of 4-Tb NAS drives, 1 pair of 3Tb NAS drives and 1 pair of 2Tb Nas drives, each pair is configured to RAID1 .
Before the new year, the 2Tb drives will be replace with a new pair of 4Tb NAS drives. Each drive is mounted on a Centos7 machine with /etc/fstab & a mount -a notation in crontab. The plex server runs solo on this machine. Each of the drives is also a mapped network drive in my windows 7 Pro where my Filebot currently resides.
1 drive is about 80% full; 2 are about 60% full, and one is about 10%.
Each drive has the same root folders /Movies/, /TV_Series/, /Concerts/, /Music/, /Documentary Movies/, /Documentary Series/
The first thing I'd like to do is have all the folder & files (relatively) evenly deployed throughout the available drives.
Next would be to evaluate each folder, adding subtitles, art, etc to each.
Finally, create 2 scripts to maintain and add to the library. Both to be run automatically for each media file addition. One running on my Windows box and another to run from my wife's macbook air.