mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-22 15:58:52 -05:00
omdbInfo.votes && omdbInfo.rating may be null
This commit is contained in:
parent
147cd00ddb
commit
9268fd5b52
@ -212,19 +212,21 @@ tvdb_updates.values().each{ update ->
|
||||
if (imdbid) tryLogCatch {
|
||||
def omdbInfo = OMDb.getMovieInfo(new Movie(imdbid.match(/tt(\d+)/) as int))
|
||||
|
||||
votes = omdbInfo.votes as int
|
||||
rating = omdbInfo.rating as double
|
||||
|
||||
seriesNames += omdbInfo.name
|
||||
seriesNames += omdbInfo.originalName
|
||||
seriesNames += omdbInfo.alternativeTitles
|
||||
|
||||
// scrape extra alias titles from webpage (not supported yet by API yet)
|
||||
if (votes >= 60 && rating >= 4) {
|
||||
def jsoup = org.jsoup.Jsoup.connect("https://www.thetvdb.com/series/${seriesInfo.slug}").get()
|
||||
def intlseries = jsoup.select('#translations div.change_translation_text')*.attr('data-title')*.trim()
|
||||
log.fine "Scraped data $intlseries for series $seriesNames"
|
||||
seriesNames += intlseries
|
||||
if (omdbInfo.votes && omdbInfo.rating) {
|
||||
votes = omdbInfo.votes as int
|
||||
rating = omdbInfo.rating as double
|
||||
|
||||
// scrape extra alias titles from webpage (not supported yet by API yet)
|
||||
if (votes >= 60 && rating >= 4) {
|
||||
def jsoup = org.jsoup.Jsoup.connect("https://www.thetvdb.com/series/${seriesInfo.slug}").get()
|
||||
def intlseries = jsoup.select('#translations div.change_translation_text')*.attr('data-title')*.trim()
|
||||
log.fine "Scraped data $intlseries for series $seriesNames"
|
||||
seriesNames += intlseries
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user