Music works, put only via PMS IP saved in Kodi DB

This commit is contained in:
tomkat83 2016-02-19 16:02:58 +01:00
parent a4e1a622e0
commit 9b6cdbafc2

View file

@ -1855,21 +1855,21 @@ class Music(Items):
comment = None comment = None
# Plex works a bit differently # Plex works a bit differently
if self.directstream: # if self.directstream:
paths = "%s%s" % (self.server, item[0][0][0].attrib.get('key')) paths = "%s%s" % (self.server, item[0][0].attrib.get('key'))
paths = paths.rsplit('/', 1) paths = paths.rsplit('/', 1)
path = paths[0] path = paths[0] + '/'
filename = paths[1] filename = paths[1] + '?X-Plex-Token=ihfViFUqqJf1vWrchnA9'
else: # else:
path = "plugin://plugin.video.plexkodiconnect.movies/" # path = "plugin://plugin.audio.plexkodiconnect.music/"
filename = API.getKey() # filename = API.getKey()
params = { # params = {
'filename': filename, # 'filename': filename,
'id': itemid, # 'id': itemid,
'dbid': songid, # 'dbid': songid,
'mode': "play" # 'mode': "play"
} # }
filename = "%s?%s" % (path, urllib.urlencode(params)) # filename = "%s?%s" % (path, urllib.urlencode(params))
# UPDATE THE SONG ##### # UPDATE THE SONG #####
if update_item: if update_item:
@ -1974,7 +1974,8 @@ class Music(Items):
# Create the reference in emby table # Create the reference in emby table
emby_db.addReference( emby_db.addReference(
itemid, songid, "Audio", "song", pathid=pathid, itemid, songid, "Audio", "song",
pathid=pathid,
parentid=albumid, parentid=albumid,
checksum=checksum) checksum=checksum)
@ -2035,18 +2036,8 @@ class Music(Items):
kodicursor.execute(query, (artistid, albumid, artist_name)) kodicursor.execute(query, (artistid, albumid, artist_name))
if addArtist: if addArtist:
if kodiversion in (16, 17): query = "UPDATE album SET strArtists = ? WHERE idAlbum = ?"
# Kodi Jarvis, Krypton kodicursor.execute(query, (artist_name, albumid))
query = "UPDATE album SET strArtists = ? WHERE idAlbum = ?"
kodicursor.execute(query, (artist_name, albumid))
elif kodiversion == 15:
# Kodi Isengard
query = "UPDATE album SET strArtists = ? WHERE idAlbum = ?"
kodicursor.execute(query, (artist_name, albumid))
else:
# Kodi Helix
query = "UPDATE album SET strArtists = ? WHERE idAlbum = ?"
kodicursor.execute(query, (artist_name, albumid))
# Add genres # Add genres
kodi_db.addMusicGenres(songid, genres, "song") kodi_db.addMusicGenres(songid, genres, "song")