From 0aa2e7132003b8ebf600b001d42e4fc00507d505 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 23 Jan 2021 16:52:48 -0500 Subject: [PATCH] Fix music artist syncing for Kodi 19 --- jellyfin_kodi/objects/kodi/music.py | 7 ++++++- jellyfin_kodi/objects/kodi/queries_music.py | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/jellyfin_kodi/objects/kodi/music.py b/jellyfin_kodi/objects/kodi/music.py index dd7a78c9..01d324e6 100644 --- a/jellyfin_kodi/objects/kodi/music.py +++ b/jellyfin_kodi/objects/kodi/music.py @@ -88,7 +88,12 @@ class Music(Kodi): self.cursor.execute(QU.update_artist_name, args) def update(self, *args): - self.cursor.execute(QU.update_artist, args) + if self.version_id < 74: + self.cursor.execute(QU.update_artist74, args) + else: + # No field for backdrops in Kodi 19, so we need to omit that here + args = args[:3] + args[4:] + self.cursor.execute(QU.update_artist82, args) def link(self, *args): self.cursor.execute(QU.update_link, args) diff --git a/jellyfin_kodi/objects/kodi/queries_music.py b/jellyfin_kodi/objects/kodi/queries_music.py index 53d85ece..bf56797e 100644 --- a/jellyfin_kodi/objects/kodi/queries_music.py +++ b/jellyfin_kodi/objects/kodi/queries_music.py @@ -154,11 +154,16 @@ SET strArtist = ? WHERE idArtist = ? """ update_artist_name_obj = ["{Name}", "{ArtistId}"] -update_artist = """ +update_artist74 = """ UPDATE artist SET strGenres = ?, strBiography = ?, strImage = ?, strFanart = ?, lastScraped = ? WHERE idArtist = ? """ +update_artist82 = """ +UPDATE artist +SET strGenres = ?, strBiography = ?, strImage = ?, lastScraped = ? +WHERE idArtist = ? +""" update_link = """ INSERT OR REPLACE INTO album_artist(idArtist, idAlbum, strArtist) VALUES (?, ?, ?)