From 133773d5b6f4d76711039d5e1ace17cce16172f4 Mon Sep 17 00:00:00 2001 From: xnappo Date: Sun, 31 Jul 2016 12:15:38 -0500 Subject: [PATCH] Krypton prep --- resources/lib/itemtypes.py | 39 +++++++++++++++++++++++++++++--------- resources/lib/utils.py | 2 +- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 7438c83f..ad408b0f 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -2158,15 +2158,36 @@ class Music(Items): artist_edb = emby_db.getItem_byId(artist_eid) artistid = artist_edb[0] finally: - query = ( - ''' - INSERT OR REPLACE INTO song_artist(idArtist, idSong, iOrder, strArtist) - - VALUES (?, ?, ?, ?) - ''' - ) - kodicursor.execute(query, (artistid, songid, index, artist_name)) - + if self.kodiversion >= 17: + # Kodi Krypton + query = ( + ''' + INSERT OR REPLACE INTO song_artist(idArtist, idSong, idRole, iOrder, strArtist) + + VALUES (?, ?, ?, ?, ?) + ''' + ) + kodicursor.execute(query, (artistid, songid, 1, index, artist_name)) + + # May want to look into only doing this once? + query = ( + ''' + INSERT OR REPLACE INTO role(idRole, strRole) + + VALUES (?, ?) + ''' + ) + kodicursor.execute(query, (1, 'Composer')) + else: + query = ( + ''' + INSERT OR REPLACE INTO song_artist(idArtist, idSong, iOrder, strArtist) + + VALUES (?, ?, ?, ?) + ''' + ) + kodicursor.execute(query, (artistid, songid, index, artist_name)) + # Verify if album artist exists album_artists = [] for artist in item['AlbumArtists']: diff --git a/resources/lib/utils.py b/resources/lib/utils.py index db01fd35..84c32624 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -79,7 +79,7 @@ def getKodiVideoDBPath(): "14": 90, # Helix "15": 93, # Isengard "16": 99, # Jarvis - "17": 104 # Krypton + "17": 106 # Krypton } dbPath = xbmc.translatePath(