From 4834d33d2dcce798d1c026682cf224bf430d1034 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 11 May 2015 18:45:02 +0000 Subject: [PATCH] * optimize build-data --- build-data/BuildData.groovy | 2 +- build-data/build-data-import.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build-data/BuildData.groovy b/build-data/BuildData.groovy index 244fa55b..b1a3d1d7 100755 --- a/build-data/BuildData.groovy +++ b/build-data/BuildData.groovy @@ -120,7 +120,7 @@ new File('osdb.txt').eachLine('UTF-8'){ // 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[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' : '?', fields[5] as int] + osdb << [fields[1] as int, fields[2], fields[3] as int, fields[4] == /movie/ ? 'm' : fields[4] == /tv series/ ? 's' : '?', 0] } } } diff --git a/build-data/build-data-import.sh b/build-data/build-data-import.sh index 8d64681d..ff6d7b2d 100755 --- a/build-data/build-data-import.sh +++ b/build-data/build-data-import.sh @@ -1,5 +1,6 @@ #!/bin/sh +# initialize dump files if necessary for DUMP in "omdb.zip" "tvdb.zip" "anidb.gz" "osdb.gz" do if [ ! -f "$DUMP" ]; then @@ -8,7 +9,7 @@ do done echo 'Fetch OMDB dump' -if test "`find omdb.zip -mtime +20`"; then +if test "`find omdb.zip -mtime +30`"; then curl -L -o omdb.zip -z omdb.zip "http://beforethecode.com/projects/omdb/download.aspx?e=reinhard.pointner%40gmail.com&tsv=movies" unzip -o omdb.zip fi @@ -22,10 +23,11 @@ fi echo 'Fetch AniDB dump' if test "`find anidb.gz -mtime +5`"; then curl -L -o anidb.gz -z anidb.gz "http://anidb.net/api/anime-titles.dat.gz" + gunzip -c anidb.gz > anidb.txt fi echo 'Fetch OSDB dump' -if test "`find osdb.gz -mtime +20`"; then +if test "`find osdb.gz -mtime +30`"; then curl -L -o osdb.gz -z osdb.gz "http://www.opensubtitles.org/addons/export_movie.php" -sH 'Accept-encoding: gzip' gunzip -c osdb.gz > osdb.txt fi