mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Fix albums with same name
This commit is contained in:
parent
227bb3eb42
commit
77de12bec8
1 changed files with 10 additions and 22 deletions
|
@ -1050,29 +1050,17 @@ class Kodidb_Functions():
|
||||||
try:
|
try:
|
||||||
albumid = cursor.fetchone()[0]
|
albumid = cursor.fetchone()[0]
|
||||||
except TypeError:
|
except TypeError:
|
||||||
# Verify by name
|
# Create the album
|
||||||
query = ' '.join((
|
cursor.execute("select coalesce(max(idAlbum),0) from album")
|
||||||
|
albumid = cursor.fetchone()[0] + 1
|
||||||
|
query = (
|
||||||
|
'''
|
||||||
|
INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID)
|
||||||
|
|
||||||
"SELECT idAlbum",
|
VALUES (?, ?, ?)
|
||||||
"FROM album",
|
'''
|
||||||
"WHERE strAlbum = ?",
|
)
|
||||||
"COLLATE NOCASE"
|
cursor.execute(query, (albumid, name, musicbrainz))
|
||||||
))
|
|
||||||
cursor.execute(query, (name,))
|
|
||||||
try:
|
|
||||||
albumid = cursor.fetchone()[0]
|
|
||||||
except TypeError:
|
|
||||||
# Create the album
|
|
||||||
cursor.execute("select coalesce(max(idAlbum),0) from album")
|
|
||||||
albumid = cursor.fetchone()[0] + 1
|
|
||||||
query = (
|
|
||||||
'''
|
|
||||||
INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID)
|
|
||||||
|
|
||||||
VALUES (?, ?, ?)
|
|
||||||
'''
|
|
||||||
)
|
|
||||||
cursor.execute(query, (albumid, name, musicbrainz))
|
|
||||||
|
|
||||||
return albumid
|
return albumid
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue