2012-07-21 20:35:13 +00:00
|
|
|
// filebot -script fn:housekeeping /path/to/folder/ --output /output/folder/ --format <expression>
|
2011-12-19 11:59:43 +00:00
|
|
|
|
|
|
|
/*
|
2012-09-17 15:21:17 +00:00
|
|
|
* Watch folder for new tv shows and automatically move/rename new episodes
|
|
|
|
*/
|
2011-12-19 11:59:43 +00:00
|
|
|
|
2012-01-05 05:30:22 +00:00
|
|
|
// check for new media files once every 5 minutes
|
|
|
|
def updateFrequency = 5 * 60 * 1000
|
2011-12-19 11:59:43 +00:00
|
|
|
|
|
|
|
// spawn daemon thread
|
|
|
|
Thread.startDaemon {
|
|
|
|
while (sleep(updateFrequency) || true) {
|
2012-07-23 04:54:50 +00:00
|
|
|
// extract all
|
|
|
|
if (_args.extract) {
|
|
|
|
extract(file:args.getFiles{ it.isArchive() }, output:'.')
|
|
|
|
}
|
|
|
|
|
|
|
|
// subtitles for all
|
|
|
|
if (_args.getSubtitles) {
|
|
|
|
getMissingSubtitles(file:args.getFiles{ it.isVideo() }, output:'srt')
|
|
|
|
}
|
|
|
|
|
|
|
|
// rename all
|
|
|
|
if (_args.rename) {
|
|
|
|
args.eachMediaFolder {
|
|
|
|
rename(folder:it)
|
|
|
|
}
|
2011-12-19 11:59:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
println "Press ENTER to abort"
|
|
|
|
console.readLine() // keep script running until aborted by user
|