2011-12-19 06:59:43 -05:00
|
|
|
// filebot -script "http://filebot.sourceforge.net/data/shell/housekeeping.groovy" <folder>
|
|
|
|
|
2011-12-22 14:36:31 -05:00
|
|
|
// EXPERIMENTAL // HERE THERE BE DRAGONS
|
|
|
|
if (net.sourceforge.filebot.Settings.applicationRevisionNumber < 783) throw new Exception("Revision 783+ required")
|
|
|
|
|
|
|
|
|
2011-12-19 06:59:43 -05:00
|
|
|
/*
|
|
|
|
* Watch folder for new tv shows and automatically
|
|
|
|
* move/rename new episodes into a predefined folder structure
|
|
|
|
*/
|
|
|
|
|
|
|
|
// check for new media files once every 5 seconds
|
|
|
|
def updateFrequency = 5 * 1000;
|
|
|
|
|
|
|
|
// V:/TV Shows/Stargate/Season 1/Stargate.S01E01.Pilot
|
2011-12-22 14:36:31 -05:00
|
|
|
def episodeFormat = "{com.sun.jna.Platform.isWindows() ? file[0] : home}/TV Shows/{n}{'/Season '+s}/{n.space('.')}.{s00e00}.{t.space('.')}"
|
2011-12-19 06:59:43 -05:00
|
|
|
|
|
|
|
// spawn daemon thread
|
|
|
|
Thread.startDaemon {
|
|
|
|
while (sleep(updateFrequency) || true) {
|
|
|
|
args.eachMediaFolder {
|
|
|
|
rename(folder:it, db: "thetvdb", format:episodeFormat)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
println "Press ENTER to abort"
|
|
|
|
console.readLine() // keep script running until aborted by user
|