Skip to content

Commit

Permalink
* allow processing of subtitles even the corresponding video has alre…
Browse files Browse the repository at this point in the history
…ady been renamed in a previous call
  • Loading branch information
rednoah committed Nov 16, 2014
1 parent 43ba09d commit 9b6a161
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions amc.groovy
Expand Up @@ -213,7 +213,6 @@ def relativeInputPath = { f ->

// keep original input around so we can print excluded files later
def originalInputSet = input as LinkedHashSet
def videoFolderSet = input.findAll{ it.isVideo() }.findResults{ it.parentFile } as LinkedHashSet

// process only media files
input = input.findAll{ f -> (f.isVideo() && !tryQuietly{ f.hasExtension('iso') && !f.isDisk() }) || f.isSubtitle() || (f.isDirectory() && f.isDisk()) || (music && f.isAudio()) }
Expand All @@ -225,7 +224,7 @@ input = input.findAll{ f -> !(relativeInputPath(f) =~ /(?<=\b|_)(?i:sample|trail
input = input.findAll{ f -> !(f.isVideo() && ((minFileSize > 0 && f.length() < minFileSize) || (minLengthMS > 0 && tryQuietly{ getMediaInfo(file:f, format:'{duration}').toLong() < minLengthMS }))) }

// ignore subtitles files that are not stored in the same folder as the movie
input = input.findAll{ f -> !(f.isSubtitle() && !videoFolderSet.contains(f.parentFile)) }
input = input.findAll{ f -> !(f.isSubtitle() && !f.parentFile.listFiles{ it.isVideo() }.any{ f.isDerived(it) }) }


// print exclude and input sets for logging
Expand Down

0 comments on commit 9b6a161

Please sign in to comment.