From b65d6baad0369eb383e6efb052a9e617721e1a0a Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Tue, 6 Sep 2016 22:57:33 -0500 Subject: [PATCH] Sync season name for Jarvis or higher --- resources/lib/itemtypes.py | 2 +- resources/lib/kodidb_functions.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 7ffc09e7..12a3ddeb 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -1192,7 +1192,7 @@ class TVShows(Items): self.add_update(show) return - seasonid = self.kodi_db.addSeason(showid, seasonnum) + seasonid = self.kodi_db.addSeason(showid, seasonnum, item['Name']) if item['LocationType'] != "Virtual": # Create the reference in emby table diff --git a/resources/lib/kodidb_functions.py b/resources/lib/kodidb_functions.py index 3e3cc4cc..5f36f60f 100644 --- a/resources/lib/kodidb_functions.py +++ b/resources/lib/kodidb_functions.py @@ -978,7 +978,7 @@ class Kodidb_Functions(): )) self.cursor.execute(query, (movieid,)) - def addSeason(self, showid, seasonnumber): + def addSeason(self, showid, seasonnumber, season_name=None): query = ' '.join(( @@ -996,6 +996,10 @@ class Kodidb_Functions(): query = "INSERT INTO seasons(idSeason, idShow, season) values(?, ?, ?)" self.cursor.execute(query, (seasonid, showid, seasonnumber)) + if self.kodiversion in (16,17) and season_name is not None: + query = "UPDATE seasons SET name = ? WHERE idSeason = ?" + self.cursor.execute(query, (season_name, seasonid)) + return seasonid def addArtist(self, name, musicbrainz):