* added getMissingSubtitles() to shell API
This commit is contained in:
parent
3762d4f392
commit
6e10fd5c4b
|
@ -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) }
|
_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) {
|
def check(args) {
|
||||||
_guarded { _cli.check(_files(args)) }
|
_guarded { _cli.check(_files(args)) }
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Fetch subtitles, rename and calculate checksums for all video files
|
* Fetch subtitles, rename and calculate checksums for all video files
|
||||||
*/
|
*/
|
||||||
args.eachMediaFolder {
|
args.eachMediaFolder {
|
||||||
getSubtitles(folder:it)
|
getMissingSubtitles(folder:it)
|
||||||
rename(folder:it)
|
rename(folder:it)
|
||||||
compute(file:it.listFiles().findAll{ it.isVideo() })
|
compute(file:it.listFiles().findAll{ it.isVideo() })
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,5 +4,5 @@
|
||||||
* Get subtitles for all your media files
|
* Get subtitles for all your media files
|
||||||
*/
|
*/
|
||||||
args.eachMediaFolder {
|
args.eachMediaFolder {
|
||||||
getSubtitles(folder:it)
|
getMissingSubtitles(folder:it)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
|
||||||
}
|
|
Loading…
Reference in New Issue