* add file.dir.path rules to AMC to separate Movies/TV.Shows/Anime by folder names

This commit is contained in:
Reinhard Pointner 2013-11-23 04:53:59 +00:00
parent d8751ea088
commit beacccdeeb
3 changed files with 6 additions and 5 deletions

View File

@ -11,7 +11,7 @@ import java.util.regex.Pattern
File.metaClass.getAt = { Range range -> listPath(delegate).collect{ replacePathSeparators(getName(it)).trim() }.getAt(range).join(File.separator) } File.metaClass.getAt = { Range range -> listPath(delegate).collect{ replacePathSeparators(getName(it)).trim() }.getAt(range).join(File.separator) }
File.metaClass.getAt = { int index -> listPath(delegate).collect{ replacePathSeparators(getName(it)).trim() }.getAt(index) } File.metaClass.getAt = { int index -> listPath(delegate).collect{ replacePathSeparators(getName(it)).trim() }.getAt(index) }
File.metaClass.getRoot = { listPath(delegate)[0] } File.metaClass.getRoot = { listPath(delegate)[0] }
File.metaClass.listPath = { listPath(delegate) } File.metaClass.listPath = { int tailSize = 100, boolean reversePath = false -> listPathTail(delegate, tailSize, reversePath) }
File.metaClass.getDiskSpace = { listPath(delegate).reverse().find{ it.exists() }?.usableSpace ?: 0 } File.metaClass.getDiskSpace = { listPath(delegate).reverse().find{ it.exists() }?.usableSpace ?: 0 }

View File

@ -572,6 +572,7 @@ DEFiNiTiON
DEFUSED DEFUSED
DEiTY DEiTY
DELiCiOUS DELiCiOUS
DEMAND
DEPRAViTY DEPRAViTY
DEPRiVED DEPRiVED
dEr dEr

View File

@ -50,19 +50,19 @@ def format = [
// force movie/series/anime logic // force movie/series/anime logic
def forceMovie(f) { def forceMovie(f) {
tryQuietly{ ut_label } =~ /^(?i:Movie|Couch.Potato)/ || f.path =~ /(?<=tt)\\d{7}/ || tryQuietly{ f.metadata?.object?.class.name =~ /Movie/ } tryQuietly{ ut_label } =~ /^(?i:Movie|Couch.Potato)/ || f.dir.path =~ /(?i:Movies)/ || f.path =~ /(?<=tt)\\d{7}/ || tryQuietly{ f.metadata?.object?.class.name =~ /Movie/ }
} }
def forceSeries(f) { def forceSeries(f) {
tryQuietly{ ut_label } =~ /^(?i:TV|Kids.Shows)/ || parseEpisodeNumber(f.path) || parseDate(f.path) || f.path =~ /(?i:Season)\D?[0-9]{1,2}\D/ || tryQuietly{ f.metadata?.object?.class.name =~ /Episode/ } tryQuietly{ ut_label } =~ /^(?i:TV|Kids.Shows)/ || f.dir.path =~ /(?i:TV.Shows)/ || parseEpisodeNumber(f.path) || parseDate(f.path) || f.path =~ /(?i:Season)\D?[0-9]{1,2}\D/ || tryQuietly{ f.metadata?.object?.class.name =~ /Episode/ }
} }
def forceAnime(f) { def forceAnime(f) {
tryQuietly{ ut_label } =~ /^(?i:Anime)/ || (f.isVideo() && (f.name =~ "[\\(\\[]\\p{XDigit}{8}[\\]\\)]" || getMediaInfo(file:f, format:'''{media.AudioLanguageList} {media.TextCodecList}''').tokenize().containsAll(['Japanese', 'ASS']))) tryQuietly{ ut_label } =~ /^(?i:Anime)/ || f.dir.path =~ /(?i:Anime)/ || (f.isVideo() && (f.name =~ "[\\(\\[]\\p{XDigit}{8}[\\]\\)]" || getMediaInfo(file:f, format:'''{media.AudioLanguageList} {media.TextCodecList}''').tokenize().containsAll(['Japanese', 'ASS'])))
} }
def forceIgnore(f) { def forceIgnore(f) {
tryQuietly{ ut_label } =~ /^(?i:ebook|other|ignore)/ || f.path =~ tryQuietly{ ignore } tryQuietly{ ut_label } =~ /^(?i:ebook|other|ignore)/ || f.dir.path =~ /(?i:other)/ || f.path =~ tryQuietly{ ignore }
} }