2011-12-27 18:54:25 +00:00
|
|
|
// filebot -script "http://filebot.sf.net/scripts/housekeeping.groovy" <folder>
|
2011-12-19 11:59:43 +00:00
|
|
|
|
2011-12-22 19:36:31 +00:00
|
|
|
// EXPERIMENTAL // HERE THERE BE DRAGONS
|
|
|
|
if (net.sourceforge.filebot.Settings.applicationRevisionNumber < 783) throw new Exception("Revision 783+ required")
|
|
|
|
|
|
|
|
|
2011-12-19 11:59:43 +00: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
|
2011-12-27 18:54:25 +00:00
|
|
|
def updateFrequency = 5 * 1000
|
2011-12-19 11:59:43 +00:00
|
|
|
|
|
|
|
// V:/TV Shows/Stargate/Season 1/Stargate.S01E01.Pilot
|
2011-12-22 19:36:31 +00:00
|
|
|
def episodeFormat = "{com.sun.jna.Platform.isWindows() ? file[0] : home}/TV Shows/{n}{'/Season '+s}/{n.space('.')}.{s00e00}.{t.space('.')}"
|
2011-12-19 11:59:43 +00: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
|