mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 12:16:12 +00:00
Music support for Leia
This commit is contained in:
parent
76dde9f8dd
commit
307bb772b3
3 changed files with 40 additions and 54 deletions
|
@ -25,10 +25,6 @@ KODI = xbmc.getInfoLabel('System.BuildVersion')[:2]
|
||||||
def video_database():
|
def video_database():
|
||||||
db_version = {
|
db_version = {
|
||||||
|
|
||||||
'13': 78, # Gotham
|
|
||||||
'14': 90, # Helix
|
|
||||||
'15': 93, # Isengard
|
|
||||||
'16': 99, # Jarvis
|
|
||||||
'17': 107,# Krypton
|
'17': 107,# Krypton
|
||||||
'18': 109 # Leia
|
'18': 109 # Leia
|
||||||
}
|
}
|
||||||
|
@ -38,12 +34,8 @@ def video_database():
|
||||||
def music_database():
|
def music_database():
|
||||||
db_version = {
|
db_version = {
|
||||||
|
|
||||||
'13': 46, # Gotham
|
|
||||||
'14': 48, # Helix
|
|
||||||
'15': 52, # Isengard
|
|
||||||
'16': 56, # Jarvis
|
|
||||||
'17': 60, # Krypton
|
'17': 60, # Krypton
|
||||||
'18': 68 # Leia
|
'18': 70 # Leia
|
||||||
}
|
}
|
||||||
return xbmc.translatePath("special://database/MyMusic%s.db"
|
return xbmc.translatePath("special://database/MyMusic%s.db"
|
||||||
% db_version.get(KODI, "")).decode('utf-8')
|
% db_version.get(KODI, "")).decode('utf-8')
|
||||||
|
|
|
@ -131,6 +131,16 @@ class KodiMusic(KodiItems):
|
||||||
))
|
))
|
||||||
self.cursor.execute(query, (args))
|
self.cursor.execute(query, (args))
|
||||||
|
|
||||||
|
def update_artist_18(self, *args):
|
||||||
|
query = ' '.join((
|
||||||
|
|
||||||
|
"UPDATE artist",
|
||||||
|
"SET strGenres = ?, strBiography = ?, strImage = ?, strFanart = ?,",
|
||||||
|
"lastScraped = ?",
|
||||||
|
"WHERE idArtist = ?"
|
||||||
|
))
|
||||||
|
self.cursor.execute(query, (args))
|
||||||
|
|
||||||
def link_artist(self, kodi_id, album_id, name):
|
def link_artist(self, kodi_id, album_id, name):
|
||||||
query = (
|
query = (
|
||||||
'''
|
'''
|
||||||
|
@ -168,23 +178,13 @@ class KodiMusic(KodiItems):
|
||||||
def _add_album(self, name, musicbrainz):
|
def _add_album(self, name, musicbrainz):
|
||||||
|
|
||||||
album_id = self.create_entry_album()
|
album_id = self.create_entry_album()
|
||||||
if self.kodi_version > 14:
|
query = (
|
||||||
query = (
|
'''
|
||||||
'''
|
INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID, strReleaseType)
|
||||||
INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID, strReleaseType)
|
VALUES (?, ?, ?, ?)
|
||||||
VALUES (?, ?, ?, ?)
|
'''
|
||||||
'''
|
)
|
||||||
)
|
self.cursor.execute(query, (album_id, name, musicbrainz, "album"))
|
||||||
self.cursor.execute(query, (album_id, name, musicbrainz, "album"))
|
|
||||||
else:
|
|
||||||
# TODO: Remove Helix code when Krypton is RC
|
|
||||||
query = (
|
|
||||||
'''
|
|
||||||
INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID)
|
|
||||||
VALUES (?, ?, ?)
|
|
||||||
'''
|
|
||||||
)
|
|
||||||
self.cursor.execute(query, (album_id, name, musicbrainz))
|
|
||||||
|
|
||||||
return album_id
|
return album_id
|
||||||
|
|
||||||
|
@ -192,7 +192,17 @@ class KodiMusic(KodiItems):
|
||||||
query = ' '.join((
|
query = ' '.join((
|
||||||
|
|
||||||
"UPDATE album",
|
"UPDATE album",
|
||||||
"SET strArtists = ?, iYear = ?, strGenres = ?, strReview = ?, strImage = ?,",
|
"SET strArtist = ?, iYear = ?, strGenres = ?, strReview = ?, strImage = ?,",
|
||||||
|
"iUserrating = ?, lastScraped = ?, strReleaseType = ?",
|
||||||
|
"WHERE idAlbum = ?"
|
||||||
|
))
|
||||||
|
self.cursor.execute(query, (args))
|
||||||
|
|
||||||
|
def update_album_18(self, *args):
|
||||||
|
query = ' '.join((
|
||||||
|
|
||||||
|
"UPDATE album",
|
||||||
|
"SET strArtistDisp = ?, iYear = ?, strGenres = ?, strReview = ?, strImage = ?,",
|
||||||
"iUserrating = ?, lastScraped = ?, strReleaseType = ?",
|
"iUserrating = ?, lastScraped = ?, strReleaseType = ?",
|
||||||
"WHERE idAlbum = ?"
|
"WHERE idAlbum = ?"
|
||||||
))
|
))
|
||||||
|
@ -252,27 +262,6 @@ class KodiMusic(KodiItems):
|
||||||
)
|
)
|
||||||
self.cursor.execute(query, (args))
|
self.cursor.execute(query, (args))
|
||||||
|
|
||||||
def add_single_15(self, *args):
|
|
||||||
query = (
|
|
||||||
'''
|
|
||||||
INSERT INTO album(idAlbum, strGenres, iYear, dateAdded, strReleaseType)
|
|
||||||
|
|
||||||
VALUES (?, ?, ?, ?, ?)
|
|
||||||
'''
|
|
||||||
)
|
|
||||||
self.cursor.execute(query, (args))
|
|
||||||
|
|
||||||
def add_single_14(self, *args):
|
|
||||||
# TODO: Remove Helix code when Krypton is RC
|
|
||||||
query = (
|
|
||||||
'''
|
|
||||||
INSERT INTO album(idAlbum, strGenres, iYear, dateAdded)
|
|
||||||
|
|
||||||
VALUES (?, ?, ?, ?)
|
|
||||||
'''
|
|
||||||
)
|
|
||||||
self.cursor.execute(query, (args))
|
|
||||||
|
|
||||||
def add_song(self, *args):
|
def add_song(self, *args):
|
||||||
query = (
|
query = (
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -234,10 +234,10 @@ class Music(Items):
|
||||||
emby_db.addReference(itemid, artistid, artisttype, "artist", checksum=checksum)
|
emby_db.addReference(itemid, artistid, artisttype, "artist", checksum=checksum)
|
||||||
|
|
||||||
# Process the artist
|
# Process the artist
|
||||||
if self.kodi_version > 15:
|
if self.kodi_version > 18:
|
||||||
self.kodi_db.update_artist_16(genres, bio, thumb, fanart, lastScraped, artistid)
|
|
||||||
else:
|
|
||||||
self.kodi_db.update_artist(genres, bio, thumb, fanart, lastScraped, dateadded, artistid)
|
self.kodi_db.update_artist(genres, bio, thumb, fanart, lastScraped, dateadded, artistid)
|
||||||
|
else:
|
||||||
|
self.kodi_db.update_artist_18(genres, bio, thumb, fanart, lastScraped, artistid)
|
||||||
|
|
||||||
# Update artwork
|
# Update artwork
|
||||||
artwork.add_artwork(artworks, artistid, "artist", kodicursor)
|
artwork.add_artwork(artworks, artistid, "artist", kodicursor)
|
||||||
|
@ -303,8 +303,12 @@ class Music(Items):
|
||||||
emby_db.addReference(itemid, albumid, "MusicAlbum", "album", checksum=checksum)
|
emby_db.addReference(itemid, albumid, "MusicAlbum", "album", checksum=checksum)
|
||||||
|
|
||||||
# Process the album info
|
# Process the album info
|
||||||
self.kodi_db.update_album(artistname, year, genre, bio, thumb, rating, lastScraped,
|
if self.kodi_version > 18:
|
||||||
"album", albumid)
|
self.kodi_db.update_album(artistname, year, genre, bio, thumb, rating, lastScraped,
|
||||||
|
"album", albumid)
|
||||||
|
else:
|
||||||
|
self.kodi_db.update_album_18(artistname, year, genre, bio, thumb, rating, lastScraped,
|
||||||
|
"album", albumid)
|
||||||
|
|
||||||
# Assign main artists to album
|
# Assign main artists to album
|
||||||
for artist in item['AlbumArtists']:
|
for artist in item['AlbumArtists']:
|
||||||
|
@ -340,7 +344,8 @@ class Music(Items):
|
||||||
self.kodi_db.add_discography(artistid, name, year)
|
self.kodi_db.add_discography(artistid, name, year)
|
||||||
|
|
||||||
# Add genres
|
# Add genres
|
||||||
self.kodi_db.add_genres(albumid, genres, "album")
|
if self.kodi_version > 18:
|
||||||
|
self.kodi_db.add_genres(albumid, genres, "album")
|
||||||
# Update artwork
|
# Update artwork
|
||||||
artwork.add_artwork(artworks, albumid, "album", kodicursor)
|
artwork.add_artwork(artworks, albumid, "album", kodicursor)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue