Merge remote-tracking branch 'MediaBrowser/master' into develop
This commit is contained in:
commit
7e09253477
9 changed files with 87 additions and 44 deletions
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="plugin.video.plexkodiconnect"
|
||||
name="PlexKodiConnect"
|
||||
version="1.1.71"
|
||||
version="1.1.72"
|
||||
provider-name="tomkat83">
|
||||
<requires>
|
||||
<import addon="xbmc.python" version="2.1.0"/>
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
version 1.1.72
|
||||
- Fix to extrafanart
|
||||
- Fix for artists deletion
|
||||
- Fix for views
|
||||
|
||||
version 1.1.70
|
||||
- Include AirsAfterSeason for special episodes ordering
|
||||
- Cover art settings - label adjusted. A reset or repair will be required if you change the settings value.
|
||||
|
|
|
@ -112,7 +112,7 @@ class Items(object):
|
|||
|
||||
musicconn = None
|
||||
|
||||
if itemtype in ('MusicAlbum', 'MusicArtist', 'Audio'):
|
||||
if itemtype in ('MusicAlbum', 'MusicArtist', 'AlbumArtist', 'Audio'):
|
||||
if music_enabled:
|
||||
musicconn = utils.kodiSQL('music')
|
||||
musiccursor = musicconn.cursor()
|
||||
|
@ -1871,7 +1871,6 @@ class Music(Items):
|
|||
def __init__(self, embycursor, musiccursor):
|
||||
|
||||
Items.__init__(self, embycursor, musiccursor)
|
||||
self.musiccursor = musiccursor
|
||||
|
||||
self.directstream = utils.settings('streamMusic') == "true"
|
||||
self.userid = utils.window('emby_currUser')
|
||||
|
@ -1928,7 +1927,7 @@ class Music(Items):
|
|||
def add_updateArtist(self, item, artisttype="MusicArtist"):
|
||||
# Process a single artist
|
||||
kodiversion = self.kodiversion
|
||||
kodicursor = self.musiccursor
|
||||
kodicursor = self.kodicursor
|
||||
emby_db = self.emby_db
|
||||
kodi_db = self.kodi_db
|
||||
artwork = self.artwork
|
||||
|
@ -2011,7 +2010,7 @@ class Music(Items):
|
|||
# Process a single artist
|
||||
emby = self.emby
|
||||
kodiversion = self.kodiversion
|
||||
kodicursor = self.musiccursor
|
||||
kodicursor = self.kodicursor
|
||||
emby_db = self.emby_db
|
||||
kodi_db = self.kodi_db
|
||||
artwork = self.artwork
|
||||
|
@ -2169,7 +2168,7 @@ class Music(Items):
|
|||
def add_updateSong(self, item):
|
||||
# Process single song
|
||||
kodiversion = self.kodiversion
|
||||
kodicursor = self.musiccursor
|
||||
kodicursor = self.kodicursor
|
||||
emby_db = self.emby_db
|
||||
kodi_db = self.kodi_db
|
||||
artwork = self.artwork
|
||||
|
@ -2418,7 +2417,7 @@ class Music(Items):
|
|||
def updateUserdata(self, item):
|
||||
# This updates: Favorite, LastPlayedDate, Playcount, PlaybackPositionTicks
|
||||
# Poster with progress bar
|
||||
kodicursor = self.musiccursor
|
||||
kodicursor = self.kodicursor
|
||||
emby_db = self.emby_db
|
||||
kodi_db = self.kodi_db
|
||||
API = api.API(item)
|
||||
|
@ -2457,7 +2456,7 @@ class Music(Items):
|
|||
def remove(self, itemid):
|
||||
# Remove kodiid, fileid, pathid, emby reference
|
||||
emby_db = self.emby_db
|
||||
kodicursor = self.musiccursor
|
||||
kodicursor = self.kodicursor
|
||||
artwork = self.artwork
|
||||
|
||||
emby_dbitem = emby_db.getItem_byId(itemid)
|
||||
|
@ -2522,7 +2521,7 @@ class Music(Items):
|
|||
|
||||
def removeSong(self, kodiid):
|
||||
|
||||
kodicursor = self.musiccursor
|
||||
kodicursor = self.kodicursor
|
||||
artwork = self.artwork
|
||||
|
||||
artwork.deleteArtwork(kodiid, "song", kodicursor)
|
||||
|
@ -2530,7 +2529,7 @@ class Music(Items):
|
|||
|
||||
def removeAlbum(self, kodiid):
|
||||
|
||||
kodicursor = self.musiccursor
|
||||
kodicursor = self.kodicursor
|
||||
artwork = self.artwork
|
||||
|
||||
artwork.deleteArtwork(kodiid, "album", kodicursor)
|
||||
|
@ -2538,7 +2537,7 @@ class Music(Items):
|
|||
|
||||
def removeArtist(self, kodiid):
|
||||
|
||||
kodicursor = self.musiccursor
|
||||
kodicursor = self.kodicursor
|
||||
artwork = self.artwork
|
||||
|
||||
artwork.deleteArtwork(kodiid, "artist", kodicursor)
|
||||
|
|
|
@ -852,26 +852,52 @@ class Kodidb_Functions():
|
|||
|
||||
if self.kodiversion in (15, 16):
|
||||
# Kodi Isengard, Jarvis
|
||||
query = ' '.join((
|
||||
try:
|
||||
query = ' '.join((
|
||||
|
||||
"UPDATE tag_link",
|
||||
"SET tag_id = ?",
|
||||
"WHERE media_id = ?",
|
||||
"AND media_type = ?",
|
||||
"AND tag_id = ?"
|
||||
))
|
||||
cursor.execute(query, (newtag, kodiid, mediatype, oldtag,))
|
||||
"UPDATE tag_link",
|
||||
"SET tag_id = ?",
|
||||
"WHERE media_id = ?",
|
||||
"AND media_type = ?",
|
||||
"AND tag_id = ?"
|
||||
))
|
||||
cursor.execute(query, (newtag, kodiid, mediatype, oldtag,))
|
||||
except Exception as e:
|
||||
# The new tag we are going to apply already exists for this item
|
||||
# delete current tag instead
|
||||
self.logMsg("Exception: %s" % e, 1)
|
||||
query = ' '.join((
|
||||
|
||||
"DELETE FROM tag_link",
|
||||
"WHERE media_id = ?",
|
||||
"AND media_type = ?",
|
||||
"AND tag_id = ?"
|
||||
))
|
||||
cursor.execute(query, (kodiid, mediatype, oldtag,))
|
||||
else:
|
||||
# Kodi Helix
|
||||
query = ' '.join((
|
||||
try:
|
||||
query = ' '.join((
|
||||
|
||||
"UPDATE taglinks",
|
||||
"SET idTag = ?",
|
||||
"WHERE idMedia = ?",
|
||||
"AND media_type = ?",
|
||||
"AND idTag = ?"
|
||||
))
|
||||
cursor.execute(query, (newtag, kodiid, mediatype, oldtag,))
|
||||
"UPDATE taglinks",
|
||||
"SET idTag = ?",
|
||||
"WHERE idMedia = ?",
|
||||
"AND media_type = ?",
|
||||
"AND idTag = ?"
|
||||
))
|
||||
cursor.execute(query, (newtag, kodiid, mediatype, oldtag,))
|
||||
except Exception as e:
|
||||
# The new tag we are going to apply already exists for this item
|
||||
# delete current tag instead
|
||||
self.logMsg("Exception: %s" % e, 1)
|
||||
query = ' '.join((
|
||||
|
||||
"DELETE FROM taglinks",
|
||||
"WHERE idMedia = ?",
|
||||
"AND media_type = ?",
|
||||
"AND idTag = ?"
|
||||
))
|
||||
cursor.execute(query, (kodiid, mediatype, oldtag,))
|
||||
|
||||
def removeTag(self, kodiid, tagname, mediatype):
|
||||
|
||||
|
|
|
@ -43,6 +43,28 @@ class KodiMonitor(xbmc.Monitor):
|
|||
if library == "video":
|
||||
utils.window('emby_kodiScan', clear=True)
|
||||
|
||||
def onSettingsChanged(self):
|
||||
# Monitor emby settings
|
||||
currentPath = utils.settings('useDirectPaths')
|
||||
if utils.window('emby_pluginpath') != currentPath:
|
||||
# Plugin path value changed. Offer to reset
|
||||
self.logMsg("Changed to playback mode detected", 1)
|
||||
utils.window('emby_pluginpath', value=currentPath)
|
||||
resp = xbmcgui.Dialog().yesno(
|
||||
heading="Playback mode change detected",
|
||||
line1=(
|
||||
"Detected the playback mode has changed. The database "
|
||||
"needs to be recreated for the change to be applied. "
|
||||
"Proceed?"))
|
||||
if resp:
|
||||
utils.reset()
|
||||
|
||||
currentLog = utils.settings('logLevel')
|
||||
if utils.window('emby_logLevel') != currentLog:
|
||||
# The log level changed, set new prop
|
||||
self.logMsg("New log level: %s" % currentLog, 1)
|
||||
utils.window('emby_logLevel', value=currentLog)
|
||||
|
||||
def onNotification(self, sender, method, data):
|
||||
|
||||
doUtils = self.doUtils
|
||||
|
|
|
@ -486,7 +486,7 @@ class LibrarySync(threading.Thread):
|
|||
# This is only reserved for the detection of grouped views
|
||||
if (grouped_view['Type'] == "UserView" and
|
||||
grouped_view.get('CollectionType') == mediatype and
|
||||
grouped_view['Id'] not in grouped_view['Path']):
|
||||
grouped_view['Id'] not in grouped_view.get('Path', "")):
|
||||
# Take the name of the userview
|
||||
foldername = grouped_view['Name']
|
||||
break
|
||||
|
|
|
@ -44,11 +44,11 @@ class PlayUtils():
|
|||
self.API.setPartNumber(partIndex)
|
||||
playurl = None
|
||||
|
||||
# if item['MediaSources'][0]['Protocol'] == "Http":
|
||||
# # Only play as http
|
||||
# self.logMsg("File protocol is http.", 1)
|
||||
# playurl = self.httpPlay()
|
||||
# utils.window('emby_%s.playmethod' % playurl, value="DirectStream")
|
||||
if item.get('MediaSources') and item['MediaSources'][0]['Protocol'] == "Http":
|
||||
# Only play as http
|
||||
self.logMsg("File protocol is http.", 1)
|
||||
playurl = self.httpPlay()
|
||||
utils.window('emby_%s.playmethod' % playurl, value="DirectStream")
|
||||
|
||||
if self.isDirectPlay():
|
||||
self.logMsg("File is direct playing.", 1)
|
||||
|
@ -85,7 +85,7 @@ class PlayUtils():
|
|||
itemid = item['Id']
|
||||
mediatype = item['MediaType']
|
||||
|
||||
if type == "Audio":
|
||||
if mediatype == "Audio":
|
||||
playurl = "%s/emby/Audio/%s/stream" % (server, itemid)
|
||||
else:
|
||||
playurl = "%s/emby/Videos/%s/stream?static=true" % (server, itemid)
|
||||
|
|
|
@ -46,7 +46,6 @@ class UserClient(threading.Thread):
|
|||
|
||||
self.addonName = clientinfo.ClientInfo().getAddonName()
|
||||
self.doUtils = downloadutils.DownloadUtils()
|
||||
self.logLevel = int(utils.settings('logLevel'))
|
||||
|
||||
threading.Thread.__init__(self)
|
||||
|
||||
|
@ -365,15 +364,6 @@ class UserClient(threading.Thread):
|
|||
|
||||
while not monitor.abortRequested():
|
||||
|
||||
# Verify the log level
|
||||
currLogLevel = self.getLogLevel()
|
||||
if self.logLevel != currLogLevel:
|
||||
# Set new log level
|
||||
self.logLevel = currLogLevel
|
||||
utils.window('emby_logLevel', value=str(currLogLevel))
|
||||
self.logMsg("New Log Level: %s" % currLogLevel, 0)
|
||||
|
||||
|
||||
status = utils.window('emby_serverStatus')
|
||||
if status:
|
||||
# Verify the connection status to server
|
||||
|
|
|
@ -57,6 +57,7 @@ class Service():
|
|||
|
||||
utils.window('emby_logLevel', value=str(logLevel))
|
||||
utils.window('emby_kodiProfile', value=xbmc.translatePath("special://profile"))
|
||||
utils.window('emby_pluginpath', value=utils.settings('useDirectPaths'))
|
||||
|
||||
# Initial logging
|
||||
self.logMsg("======== START %s ========" % self.addonName, 0)
|
||||
|
|
Loading…
Reference in a new issue