Skip to content

Commit

Permalink
add options to disable ratings from IMDB/Trakt
Browse files Browse the repository at this point in the history
  • Loading branch information
rmrector committed Jan 25, 2020
1 parent 3915264 commit f843380
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
18 changes: 10 additions & 8 deletions python/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,17 @@ def get_details(input_uniqueids, handle, settings):
log(header + ': ' + details['error'], xbmc.LOGWARNING)
return False

imdbinfo = get_imdb_details(details['uniqueids'])
if 'error' in imdbinfo:
header = "The Movie Database Python error with website IMDB"
log(header + ': ' + imdbinfo['error'], xbmc.LOGWARNING)
else:
details = combine_scraped_details_info_and_ratings(details, imdbinfo)
if settings.getSettingString('RatingS') == 'IMDb' or settings.getSettingBool('imdbanyway'):
imdbinfo = get_imdb_details(details['uniqueids'])
if 'error' in imdbinfo:
header = "The Movie Database Python error with website IMDB"
log(header + ': ' + imdbinfo['error'], xbmc.LOGWARNING)
else:
details = combine_scraped_details_info_and_ratings(details, imdbinfo)

traktinfo = get_trakt_ratinginfo(details['uniqueids'])
details = combine_scraped_details_info_and_ratings(details, traktinfo)
if settings.getSettingString('RatingS') == 'Trakt' or settings.getSettingBool('traktanyway'):
traktinfo = get_trakt_ratinginfo(details['uniqueids'])
details = combine_scraped_details_info_and_ratings(details, traktinfo)

details = configure_scraped_details(details, settings)

Expand Down
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ msgstr ""
msgctxt "#30009"
msgid "Add multiple studios"
msgstr ""

msgctxt "#30010"
msgid "Add also Trakt.tv ratings"
msgstr ""
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_nz/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ msgstr ""
msgctxt "#30009"
msgid "Add multiple studios"
msgstr ""

msgctxt "#30010"
msgid "Add also Trakt.tv ratings"
msgstr ""
4 changes: 4 additions & 0 deletions resources/language/resource.language.en_us/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ msgstr ""
msgctxt "#30009"
msgid "Add multiple studios"
msgstr ""

msgctxt "#30010"
msgid "Add also Trakt.tv ratings"
msgstr ""
2 changes: 2 additions & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<setting label="30006" type="select" values="au|bg|br|ca|cz|ge|de|dk|ee|es|fi|fr|gb|gr|hr|hu|id|il|in|it|ir|jp|kr|lt|lv|mx|nl|no|pl|pt|ru|si|sv|th|tr|ua|us|vn|zh" id="tmdbcertcountry" default="us"/>
<setting label="30008" type="text" id="certprefix" default="Rated " />
<setting label="30003" type="labelenum" values="TMDb|IMDb|Trakt" id="RatingS" default="TMDb"/>
<setting label="30007" type="bool" id="imdbanyway" visible="!eq(-1,1)" default="false"/>
<setting label="30010" type="bool" id="traktanyway" visible="!eq(-2,2)" default="false"/>
<setting label="30009" type="bool" id="multiple_studios" default="false" />
<!-- For add-on inner workings -->
<setting id="lastUpdated" type="text" default="0" visible="false" />
Expand Down

0 comments on commit f843380

Please sign in to comment.