Update to Kodi MusicDB 72

This commit is contained in:
texke 2019-03-20 15:21:21 +01:00
commit 9ab1b9218c
2 changed files with 13 additions and 12 deletions

View file

@ -189,14 +189,15 @@ class Music(Kodi):
''' Add genres, but delete current genres first. ''' Add genres, but delete current genres first.
''' '''
#Removed for DB version 72
if media == 'album': if media == 'album':
self.cursor.execute(QU.delete_genres_album, (kodi_id,)) #self.cursor.execute(QU.delete_genres_album, (kodi_id,))
for genre in genres: for genre in genres:
genre_id = self.get_genre(genre) genre_id = self.get_genre(genre)
self.cursor.execute(QU.update_genre_album, (genre_id, kodi_id)) #self.cursor.execute(QU.update_genre_album, (genre_id, kodi_id))
elif media == 'song': elif media == 'song':
self.cursor.execute(QU.delete_genres_song, (kodi_id,)) self.cursor.execute(QU.delete_genres_song, (kodi_id,))

View file

@ -49,11 +49,11 @@ get_album = """ SELECT idAlbum
""" """
get_album_obj = [ "{AlbumId}","{Title}","{UniqueId}","{Artists}","album" get_album_obj = [ "{AlbumId}","{Title}","{UniqueId}","{Artists}","album"
] ]
get_album_by_name = """ SELECT idAlbum, strArtists get_album_by_name = """ SELECT idAlbum, strArtistDisp
FROM album FROM album
WHERE strAlbum = ? WHERE strAlbum = ?
""" """
get_album_artist = """ SELECT strArtists get_album_artist = """ SELECT strArtistDisp
FROM album FROM album
WHERE idAlbum = ? WHERE idAlbum = ?
""" """
@ -82,7 +82,7 @@ add_single = """ INSERT INTO album(idAlbum, strGenres, iYear, strReleaseTyp
""" """
add_single_obj = [ "{AlbumId}","{Genre}","{Year}","single" add_single_obj = [ "{AlbumId}","{Genre}","{Year}","single"
] ]
add_song = """ INSERT INTO song(idSong, idAlbum, idPath, strArtists, strGenres, strTitle, iTrack, add_song = """ INSERT INTO song(idSong, idAlbum, idPath, strArtistDisp, strGenres, strTitle, iTrack,
iDuration, iYear, strFileName, strMusicBrainzTrackID, iTimesPlayed, lastplayed, iDuration, iYear, strFileName, strMusicBrainzTrackID, iTimesPlayed, lastplayed,
rating, comment, dateAdded) rating, comment, dateAdded)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
@ -131,7 +131,7 @@ update_discography = """ INSERT OR REPLACE INTO discography(idArtist, strAlbu
update_discography_obj = [ "{ArtistId}","{Title}","{Year}" update_discography_obj = [ "{ArtistId}","{Title}","{Year}"
] ]
update_album = """ UPDATE album update_album = """ UPDATE album
SET strArtists = ?, iYear = ?, strGenres = ?, strReview = ?, strImage = ?, SET strArtistDisp = ?, iYear = ?, strGenres = ?, strReview = ?, strImage = ?,
iUserrating = ?, lastScraped = ?, strReleaseType = ? iUserrating = ?, lastScraped = ?, strReleaseType = ?
WHERE idAlbum = ? WHERE idAlbum = ?
""" """
@ -139,11 +139,11 @@ update_album_obj = [ "{Artists}","{Year}","{Genre}","{Bio}","{Thumb}"
"album","{AlbumId}" "album","{AlbumId}"
] ]
update_album_artist = """ UPDATE album update_album_artist = """ UPDATE album
SET strArtists = ? SET strArtistDisp = ?
WHERE idAlbum = ? WHERE idAlbum = ?
""" """
update_song = """ UPDATE song update_song = """ UPDATE song
SET idAlbum = ?, strArtists = ?, strGenres = ?, strTitle = ?, iTrack = ?, SET idAlbum = ?, strArtistDisp = ?, strGenres = ?, strTitle = ?, iTrack = ?,
iDuration = ?, iYear = ?, strFilename = ?, iTimesPlayed = ?, lastplayed = ?, iDuration = ?, iYear = ?, strFilename = ?, iTimesPlayed = ?, lastplayed = ?,
rating = ?, comment = ?, dateAdded = ? rating = ?, comment = ?, dateAdded = ?
WHERE idSong = ? WHERE idSong = ?
@ -157,7 +157,7 @@ update_song_artist = """ INSERT OR REPLACE INTO song_artist(idArtist, idSong, id
""" """
update_song_artist_obj = [ "{ArtistId}","{SongId}",1,"{Index}","{Name}" update_song_artist_obj = [ "{ArtistId}","{SongId}",1,"{Index}","{Name}"
] ]
update_song_album = """ INSERT OR REPLACE INTO albuminfosong(idAlbumInfoSong, idAlbumInfo, iTrack, update_song_album = """ INSERT OR REPLACE INTO song(idSong, idAlbum, iTrack,
strTitle, iDuration) strTitle, iDuration)
VALUES (?, ?, ?, ?, ?) VALUES (?, ?, ?, ?, ?)
""" """