From 93b5a9d8757a7bd5d4ec12727aea775e4195d895 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 3 Nov 2012 15:18:17 +0000 Subject: [PATCH] * work around what looks to be a bug in the groovy script engine --- BuildData.groovy | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/BuildData.groovy b/BuildData.groovy index d758a88a..a23be3be 100644 --- a/BuildData.groovy +++ b/BuildData.groovy @@ -81,23 +81,21 @@ osdb_tsv.getText('UTF-8').eachLine{ osdb = osdb.findAll{ it[0] <= 9999999 && it[2] >= 1930 && it[1] =~ /^[A-Z0-9]/ && it[1] =~ /[\p{Alpha}]{3}/ }.collect{ [it[0].pad(7), it[1], it[2]] } -parallel(osdb.collect{ row -> - return { - // update new data - if (!imdb_ids.contains(row[0])) { - // get original title and english title - [Locale.ROOT, Locale.ENGLISH].collect{ locale -> net.sourceforge.filebot.WebServices.IMDb.getMovieDescriptor(row[0] as int, locale) }.unique{ it as String }.each { mov -> - if (mov != null && mov.name.length() > 0 && mov.year > 0) { - println "Adding $mov" - imdb << [row[0], mov.name, mov.year] - } else { - println "Blacklisting $row" - imdb << [row[0], null] - } +osdb.each{ row -> + // update new data + if (!imdb_ids.contains(row[0])) { + // get original title and english title + [Locale.ROOT, Locale.ENGLISH].collect{ locale -> net.sourceforge.filebot.WebServices.IMDb.getMovieDescriptor(row[0] as int, locale) }.unique{ it as String }.each { mov -> + if (mov != null && mov.name.length() > 0 && mov.year > 0) { + println "Adding $mov" + imdb << [row[0], mov.name, mov.year] + } else { + println "Blacklisting $row" + imdb << [row[0], null] } } } -}, 20) +} // save updated imdb data imdb.collect{ it.join('\t') }.sort().join('\n').saveAs(imdb_tsv)