From 5c836f7911c13aae3ff28f884d056d2e07fc737e Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Mon, 9 Jan 2017 20:47:32 +0100 Subject: [PATCH] Krypton: add ratings and IMDB id for TV shows --- resources/lib/itemtypes.py | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index cbc91413..5fbbd6ca 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -555,7 +555,22 @@ class TVShows(Items): if update_item: log.info("UPDATE tvshow itemid: %s - Title: %s" % (itemid, title)) - + if KODIVERSION >= 17: + # update new ratings Kodi 17 + ratingid = self.kodi_db.get_ratingid(showid) + self.kodi_db.update_ratings(showid, + PF.KODI_TYPE_SHOW, + "default", + rating, + None, # votecount + ratingid) + # update new uniqueid Kodi 17 + uniqueid = self.kodi_db.get_uniqueid(showid) + self.kodi_db.update_uniqueid(showid, + PF.KODI_TYPE_SHOW, + tvdb, + "tvdb", + uniqueid) # Update the tvshow entry query = ' '.join(( @@ -580,7 +595,22 @@ class TVShows(Items): ##### OR ADD THE TVSHOW ##### else: log.info("ADD tvshow itemid: %s - Title: %s" % (itemid, title)) - + if KODIVERSION >= 17: + # add new ratings Kodi 17 + ratingid = self.kodi_db.create_entry_rating() + self.kodi_db.add_ratings(ratingid, + showid, + PF.KODI_TYPE_SHOW, + "default", + rating, + None) # votecount + # add new uniqueid Kodi 17 + uniqueid = self.kodi_db.create_entry_uniqueid() + self.kodi_db.add_uniqueid(uniqueid, + showid, + PF.KODI_TYPE_SHOW, + tvdb, + "tvdb") query = ' '.join(( "UPDATE path",