From 6e10fd5c4b2bf9479dcf656d55191d3c3f311661 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 28 Nov 2011 13:44:00 +0000 Subject: [PATCH] * added getMissingSubtitles() to shell API --- .../filebot/cli/ScriptShell.lib.groovy | 4 ++++ website/data/shell/src.groovy | 2 +- website/data/shell/suball.groovy | 2 +- website/data/shell/subcpl.groovy | 16 ---------------- 4 files changed, 6 insertions(+), 18 deletions(-) delete mode 100644 website/data/shell/subcpl.groovy diff --git a/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy b/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy index 9b2a7484..4c55843d 100644 --- a/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy +++ b/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy @@ -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)) } } diff --git a/website/data/shell/src.groovy b/website/data/shell/src.groovy index 8d16e672..02c94737 100644 --- a/website/data/shell/src.groovy +++ b/website/data/shell/src.groovy @@ -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() }) } diff --git a/website/data/shell/suball.groovy b/website/data/shell/suball.groovy index 079717d6..617fda63 100644 --- a/website/data/shell/suball.groovy +++ b/website/data/shell/suball.groovy @@ -4,5 +4,5 @@ * Get subtitles for all your media files */ args.eachMediaFolder { - getSubtitles(folder:it) + getMissingSubtitles(folder:it) } diff --git a/website/data/shell/subcpl.groovy b/website/data/shell/subcpl.groovy deleted file mode 100644 index a4a22cc0..00000000 --- a/website/data/shell/subcpl.groovy +++ /dev/null @@ -1,16 +0,0 @@ -// filebot -script "http://filebot.sourceforge.net/data/shell/subcpl.groovy" - -/* - * 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) -}