* only extract normal archives like zip/rar but not .iso etc

This commit is contained in:
Reinhard Pointner 2012-08-09 05:06:28 +00:00
parent acf5ad8aba
commit 7683bceda3
1 changed files with 8 additions and 5 deletions

View File

@ -49,14 +49,17 @@ if (args.empty) {
// extract archives (zip, rar, etc) that contain at least one video file // extract archives (zip, rar, etc) that contain at least one video file
input += extract(file: input, output: null, conflict: 'override', filter: { it.isVideo() }, forceExtractAll: true) input += extract(file: input.findAll{ it.isArchive() }, output: null, conflict: 'override', filter: { it.isVideo() }, forceExtractAll: true)
// process only media files // process only media files
input = input.unique().findAll{ it.isVideo() || it.isSubtitle() } input = input.findAll{ it.isVideo() || it.isSubtitle() }
// ignore clutter files // ignore clutter files
input = input.findAll{ !(it.path =~ /\b(?i:sample|trailer|extras|deleted.scenes|music.video|scrapbook)\b/) } input = input.findAll{ !(it.path =~ /\b(?i:sample|trailer|extras|deleted.scenes|music.video|scrapbook)\b/) }
// sanitize input
input = input.findAll{ it.exists() }.collect{ it.canonicalFile }.unique()
// print input fileset // print input fileset
input.each{ f -> _log.finest("Input: $f") } input.each{ f -> _log.finest("Input: $f") }
@ -71,9 +74,9 @@ def groups = input.groupBy{ f ->
if (forceMovie(f)) if (forceMovie(f))
return [mov: detectMovie(f, false)] return [mov: detectMovie(f, false)]
if (forceSeries(f)) if (forceSeries(f))
return [tvs: detectSeriesName(f)] return [tvs: detectSeriesName(f) ?: detectSeriesName(f.dir.listFiles{ it.isVideo() })]
if (forceAnime(f)) if (forceAnime(f))
return [anime: detectSeriesName(f)] return [anime: detectSeriesName(f) ?: detectSeriesName(f.dir.listFiles{ it.isVideo() })]
def tvs = detectSeriesName(f) def tvs = detectSeriesName(f)