* added getMissingSubtitles() to shell API

This commit is contained in:
Reinhard Pointner 2011-11-28 13:44:00 +00:00
parent 3762d4f392
commit 6e10fd5c4b
4 changed files with 6 additions and 18 deletions

View File

@ -36,6 +36,10 @@ def getSubtitles(args) { args = _defaults(args)
_guarded { _cli.getSubtitles(_files(args), args.query, args.lang, args.output, args.encoding, args.strict) }
}
def getMissingSubtitles(args) { args = _defaults(args)
_guarded { _cli.getMissingSubtitles(_files(args), args.query, args.lang, args.output, args.encoding, args.strict) }
}
def check(args) {
_guarded { _cli.check(_files(args)) }
}

View File

@ -4,7 +4,7 @@
* Fetch subtitles, rename and calculate checksums for all video files
*/
args.eachMediaFolder {
getSubtitles(folder:it)
getMissingSubtitles(folder:it)
rename(folder:it)
compute(file:it.listFiles().findAll{ it.isVideo() })
}

View File

@ -4,5 +4,5 @@
* Get subtitles for all your media files
*/
args.eachMediaFolder {
getSubtitles(folder:it)
getMissingSubtitles(folder:it)
}

View File

@ -1,16 +0,0 @@
// filebot -script "http://filebot.sourceforge.net/data/shell/subcpl.groovy" <options> <folder>
/*
* Fetch subtitles for all videos that currently don't have subtitles
*/
args.eachMediaFolder { dir ->
// select videos without subtitles
def videos = dir.listFiles().findAll{ video ->
video.isVideo() && !dir.listFiles().find{ sub ->
sub.isSubtitle() && sub.isDerived(video)
}
}
// fetch subtitles by hash only
getSubtitles(file:videos, strict:true)
}