From 5952c37bfae9d59a5db47dbf4b7c08fc3f65d4bc Mon Sep 17 00:00:00 2001 From: sualfred Date: Thu, 20 Apr 2017 18:32:08 +0200 Subject: [PATCH 1/2] Fixed wrong episode uniqueids in the UNIQUEID and RATING table. This will solve the problem with metadata updates of Emby --- resources/lib/objects/tvshows.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/lib/objects/tvshows.py b/resources/lib/objects/tvshows.py index 8ee56cd1..41a0fd88 100644 --- a/resources/lib/objects/tvshows.py +++ b/resources/lib/objects/tvshows.py @@ -340,17 +340,19 @@ class TVShows(Items): ##### UPDATE THE TVSHOW ##### if update_item: - log.info("UPDATE tvshow itemid: %s - Title: %s", itemid, title) + log.info("UPDATE tvshow itemid: %s - Title: %s - ShowID: %s", itemid, title, showid) # update new ratings Kodi 17 if self.kodi_version > 16: ratingid = self.kodi_db.get_ratingid(showid) + log.info("RETURNED ratingid: %s", ratingid) self.kodi_db.update_ratings(showid, "tvshow", "default", rating, votecount,ratingid) # update new uniqueid Kodi 17 if self.kodi_version > 16: uniqueid = self.kodi_db.get_uniqueid(showid) + log.info("RETURNED uniqueid: %s", uniqueid) self.kodi_db.update_uniqueid(showid, "tvshow", imdb, "imdb",uniqueid) @@ -605,17 +607,19 @@ class TVShows(Items): ##### UPDATE THE EPISODE ##### if update_item: - log.info("UPDATE episode itemid: %s - Title: %s", itemid, title) + log.info("UPDATE episode itemid: %s - Title: %s - EpisodeD: %s", itemid, title, episodeid) # update new ratings Kodi 17 if self.kodi_version >= 17: ratingid = self.kodi_db.get_ratingid(episodeid) + log.info("RETURNED ratingid: %s", ratingid) self.kodi_db.update_ratings(episodeid, "episode", "default", rating, votecount,ratingid) # update new uniqueid Kodi 17 if self.kodi_version >= 17: uniqueid = self.kodi_db.get_uniqueid(episodeid) + log.info("RETURNED uniqueid: %s", uniqueid) self.kodi_db.update_uniqueid(episodeid, "episode", tvdb, "tvdb",uniqueid) @@ -648,13 +652,13 @@ class TVShows(Items): if self.kodi_version >= 17: ratingid = self.kodi_db.create_entry_rating() - self.kodi_db.add_ratings(ratingid, showid, "episode", "default", rating, votecount) + self.kodi_db.add_ratings(ratingid, episodeid, "episode", "default", rating, votecount) # add new uniqueid Kodi 17 if self.kodi_version >= 17: uniqueid = self.kodi_db.create_entry_uniqueid() - self.kodi_db.add_uniqueid(uniqueid, showid, "episode", tvdb, "tvdb") + self.kodi_db.add_uniqueid(uniqueid, episodeid, "episode", tvdb, "tvdb") # Add path pathid = self.kodi_db.add_path(path) From 1b4f4e0b26a156d821ca4779c311c35f95b4a8bd Mon Sep 17 00:00:00 2001 From: sualfred Date: Thu, 27 Apr 2017 08:27:43 +0200 Subject: [PATCH 2/2] cleanup --- resources/lib/objects/tvshows.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/resources/lib/objects/tvshows.py b/resources/lib/objects/tvshows.py index 41a0fd88..fc19a7d1 100644 --- a/resources/lib/objects/tvshows.py +++ b/resources/lib/objects/tvshows.py @@ -340,19 +340,17 @@ class TVShows(Items): ##### UPDATE THE TVSHOW ##### if update_item: - log.info("UPDATE tvshow itemid: %s - Title: %s - ShowID: %s", itemid, title, showid) + log.info("UPDATE tvshow itemid: %s - Title: %s", itemid, title) # update new ratings Kodi 17 if self.kodi_version > 16: ratingid = self.kodi_db.get_ratingid(showid) - log.info("RETURNED ratingid: %s", ratingid) self.kodi_db.update_ratings(showid, "tvshow", "default", rating, votecount,ratingid) # update new uniqueid Kodi 17 if self.kodi_version > 16: uniqueid = self.kodi_db.get_uniqueid(showid) - log.info("RETURNED uniqueid: %s", uniqueid) self.kodi_db.update_uniqueid(showid, "tvshow", imdb, "imdb",uniqueid) @@ -607,19 +605,17 @@ class TVShows(Items): ##### UPDATE THE EPISODE ##### if update_item: - log.info("UPDATE episode itemid: %s - Title: %s - EpisodeD: %s", itemid, title, episodeid) + log.info("UPDATE episode itemid: %s - Title: %s", itemid, title) # update new ratings Kodi 17 if self.kodi_version >= 17: ratingid = self.kodi_db.get_ratingid(episodeid) - log.info("RETURNED ratingid: %s", ratingid) self.kodi_db.update_ratings(episodeid, "episode", "default", rating, votecount,ratingid) # update new uniqueid Kodi 17 if self.kodi_version >= 17: uniqueid = self.kodi_db.get_uniqueid(episodeid) - log.info("RETURNED uniqueid: %s", uniqueid) self.kodi_db.update_uniqueid(episodeid, "episode", tvdb, "tvdb",uniqueid)