mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-02 08:25:02 -04:00
* optimize build-data
This commit is contained in:
parent
3a06199255
commit
fed48d37fb
@ -120,13 +120,17 @@ new File('osdb.txt').eachLine('UTF-8'){
|
|||||||
// 0 IDMovie, 1 IDMovieImdb, 2 MovieName, 3 MovieYear, 4 MovieKind, 5 MoviePriority
|
// 0 IDMovie, 1 IDMovieImdb, 2 MovieName, 3 MovieYear, 4 MovieKind, 5 MoviePriority
|
||||||
if (fields.size() == 6 && fields[1] ==~ /\d+/ && fields[3] ==~ /\d{4}/) {
|
if (fields.size() == 6 && fields[1] ==~ /\d+/ && fields[3] ==~ /\d{4}/) {
|
||||||
if (fields[4] ==~ /movie|tv.series/ && isValidMovieName(fields[2]) && (fields[3] as int) >= 1970 && (fields[5] as int) >= 100) {
|
if (fields[4] ==~ /movie|tv.series/ && isValidMovieName(fields[2]) && (fields[3] as int) >= 1970 && (fields[5] as int) >= 100) {
|
||||||
osdb << [fields[1] as int, fields[2], fields[3] as int, fields[4] == /movie/ ? 'm' : fields[4] == /tv series/ ? 's' : '?', 0]
|
// 0 imdbid, 1 name, 2 year, 3 kind, 4 priority
|
||||||
|
osdb << [fields[1] as int, fields[2], fields[3] as int, fields[4] == /movie/ ? 'm' : fields[4] == /tv series/ ? 's' : '?', fields[5] as int]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 0 imdbid, 1 name, 2 year, 3 kind, 4 priority
|
// sort reverse by score
|
||||||
osdb = osdb.sort{ it[4] }
|
osdb.sort{ a, b -> b[4] <=> a[4] }
|
||||||
|
|
||||||
|
// reset score/priority because it's currently not used
|
||||||
|
osdb*.set(4, 0)
|
||||||
|
|
||||||
// sanity check
|
// sanity check
|
||||||
if (osdb.size() < 30000) { die('OSDB index sanity failed:' + osdb.size()) }
|
if (osdb.size() < 30000) { die('OSDB index sanity failed:' + osdb.size()) }
|
||||||
|
Loading…
Reference in New Issue
Block a user