mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-28 03:46:13 +00:00
Music and parentid changes
Verify for artists on albums without musicbrainzid with same name
This commit is contained in:
parent
eb83cfb6a4
commit
dc7cfd54c3
4 changed files with 26 additions and 18 deletions
|
@ -121,14 +121,18 @@ class Music(Kodi):
|
|||
except TypeError:
|
||||
return
|
||||
|
||||
def get_album(self, album_id, name, musicbrainz, *args):
|
||||
|
||||
if musicbrainz is not None:
|
||||
self.cursor.execute(QU.get_album, (musicbrainz,))
|
||||
else:
|
||||
self.cursor.execute(QU.get_album_by_name, (name,))
|
||||
def get_album(self, album_id, name, musicbrainz, artists=None, *args):
|
||||
|
||||
try:
|
||||
if musicbrainz is not None:
|
||||
self.cursor.execute(QU.get_album, (musicbrainz,))
|
||||
else:
|
||||
self.cursor.execute(QU.get_album_by_name, (name,))
|
||||
album = self.cursor.fetchone()
|
||||
|
||||
if album[1] and album[1] not in artists.split(' / '):
|
||||
raise TypeError
|
||||
|
||||
album_id = self.cursor.fetchone()[0]
|
||||
except TypeError:
|
||||
album_id = self.add_album(*(album_id, name, musicbrainz,) + args)
|
||||
|
|
|
@ -47,9 +47,9 @@ get_album = """ SELECT idAlbum
|
|||
FROM album
|
||||
WHERE strMusicBrainzAlbumID = ?
|
||||
"""
|
||||
get_album_obj = [ "{AlbumId}","{Title}","{UniqueId}","album"
|
||||
get_album_obj = [ "{AlbumId}","{Title}","{UniqueId}","{Artists}","album"
|
||||
]
|
||||
get_album_by_name = """ SELECT idAlbum
|
||||
get_album_by_name = """ SELECT idAlbum, strArtists
|
||||
FROM album
|
||||
WHERE strAlbum = ?
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue