Skip to content

Commit

Permalink
Add --def excludeList option (requires FileBot r7901 or higher)
Browse files Browse the repository at this point in the history
  • Loading branch information
rednoah committed Aug 12, 2020
1 parent 74c113a commit b8377a5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions amc.groovy
Expand Up @@ -35,6 +35,7 @@ extractFolder = tryQuietly{ extractFolder as File }
skipExtract = tryQuietly{ skipExtract.toBoolean() }
deleteAfterExtract = tryQuietly{ deleteAfterExtract.toBoolean() }
excludeList = tryQuietly{ def f = excludeList as File; f.isAbsolute() ? f : outputFolder.resolve(f.path) }
excludeLink = tryQuietly{ excludeLink.toBoolean() }
myepisodes = tryQuietly{ myepisodes.split(':', 2) as List }
gmail = tryQuietly{ gmail.split(':', 2) as List }
mail = tryQuietly{ mail.split(':', 5) as List }
Expand Down Expand Up @@ -214,6 +215,12 @@ def acceptFile(f) {
return false
}

// ignore previously linked files
if (excludeLink && (f.symlink || f.linkCount != 1)) {
log.finest "Exclude superfluous link: $f [$f.linkCount] $f.key"
return false
}

// accept archives if the extract feature is enabled
if (f.isArchive() || f.hasExtension('001')) {
return !skipExtract
Expand Down

0 comments on commit b8377a5

Please sign in to comment.