Fix artists/music

This commit is contained in:
angelblue05 2016-03-16 06:13:47 -05:00
parent 0af7dfeae1
commit 623c6cab85
3 changed files with 129 additions and 47 deletions

View file

@ -1086,6 +1086,7 @@ class Kodidb_Functions():
def addAlbum(self, name, musicbrainz):
kodiversion = self.kodiversion
cursor = self.cursor
query = ' '.join((
@ -1101,14 +1102,24 @@ class Kodidb_Functions():
# Create the album
cursor.execute("select coalesce(max(idAlbum),0) from album")
albumid = cursor.fetchone()[0] + 1
query = (
'''
INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID)
if kodiversion in (15, 16, 17):
query = (
'''
INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID, strReleaseType)
VALUES (?, ?, ?)
'''
)
cursor.execute(query, (albumid, name, musicbrainz))
VALUES (?, ?, ?, ?)
'''
)
cursor.execute(query, (albumid, name, musicbrainz, "album"))
else: # Helix
query = (
'''
INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID)
VALUES (?, ?, ?)
'''
)
cursor.execute(query, (albumid, name, musicbrainz))
return albumid