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):