Merge branch 'develop'
This commit is contained in:
commit
b8ff3547ea
10 changed files with 63 additions and 68 deletions
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<addon id="plugin.video.plexkodiconnect"
|
<addon id="plugin.video.plexkodiconnect"
|
||||||
name="PlexKodiConnect"
|
name="PlexKodiConnect"
|
||||||
version="1.0.8"
|
version="1.0.9"
|
||||||
provider-name="croneter">
|
provider-name="croneter">
|
||||||
<requires>
|
<requires>
|
||||||
<import addon="xbmc.python" version="2.1.0"/>
|
<import addon="xbmc.python" version="2.1.0"/>
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
version 1.0.9
|
||||||
|
- Fix Recently Added
|
||||||
|
- Update node names to reflect plex
|
||||||
|
- Fix tv show season posters not showing
|
||||||
|
- Fix TV shows episode artwork not caching
|
||||||
|
- Increase download timeout to 30s
|
||||||
|
- Increase image caching timeouts to 5s
|
||||||
|
|
||||||
version 1.0.8
|
version 1.0.8
|
||||||
- Redesigned fast incremential sync
|
- Redesigned fast incremential sync
|
||||||
- Workaround to sync Kodi time with PMS time
|
- Workaround to sync Kodi time with PMS time
|
||||||
|
|
|
@ -145,14 +145,14 @@
|
||||||
|
|
||||||
<!-- Video nodes -->
|
<!-- Video nodes -->
|
||||||
<string id="30170">Recently Added TV Shows</string><!-- Verified -->
|
<string id="30170">Recently Added TV Shows</string><!-- Verified -->
|
||||||
<string id="30171">In Progress TV Shows</string><!-- Verified -->
|
<string id="30171">On Deck TV Shows</string><!-- Verified -->
|
||||||
<string id="30172">All Music</string>
|
<string id="30172">All Music</string>
|
||||||
<string id="30173">Channels</string><!-- Verified -->
|
<string id="30173">Channels</string><!-- Verified -->
|
||||||
<string id="30174">Recently Added Movies</string><!-- Verified -->
|
<string id="30174">Recently Added Movies</string><!-- Verified -->
|
||||||
<string id="30175">Recently Added Episodes</string><!-- Verified -->
|
<string id="30175">Recently Added Episodes</string><!-- Verified -->
|
||||||
<string id="30176">Recently Added Albums</string>
|
<string id="30176">Recently Added Albums</string>
|
||||||
<string id="30177">In Progress Movies</string><!-- Verified -->
|
<string id="30177">On Deck Movies</string><!-- Verified -->
|
||||||
<string id="30178">In Progress Episodes</string><!-- Verified -->
|
<string id="30178">On Deck Episodes</string><!-- Verified -->
|
||||||
<string id="30179">Next Episodes</string><!-- Verified -->
|
<string id="30179">Next Episodes</string><!-- Verified -->
|
||||||
<string id="30180">Favorite Movies</string><!-- Verified -->
|
<string id="30180">Favorite Movies</string><!-- Verified -->
|
||||||
<string id="30181">Favorite Shows</string><!-- Verified -->
|
<string id="30181">Favorite Shows</string><!-- Verified -->
|
||||||
|
|
|
@ -173,14 +173,14 @@
|
||||||
<string id="30169">Addresse : </string>
|
<string id="30169">Addresse : </string>
|
||||||
|
|
||||||
<string id="30170">Zuletzt hinzugefügte Serien</string>
|
<string id="30170">Zuletzt hinzugefügte Serien</string>
|
||||||
<string id="30171">Begonnene Serien</string>
|
<string id="30171">Aktuell Serien</string>
|
||||||
<string id="30172">Alles an Musik</string>
|
<string id="30172">Alles an Musik</string>
|
||||||
<string id="30173">Kanäle</string>
|
<string id="30173">Kanäle</string>
|
||||||
<string id="30174">Zuletzt hinzugefügte Filme</string>
|
<string id="30174">Zuletzt hinzugefügte Filme</string>
|
||||||
<string id="30175">Zuletzt hinzugefügte Episoden</string>
|
<string id="30175">Zuletzt hinzugefügte Episoden</string>
|
||||||
<string id="30176">Zuletzt hinzugefügte Alben</string>
|
<string id="30176">Zuletzt hinzugefügte Alben</string>
|
||||||
<string id="30177">Begonnene Filme</string>
|
<string id="30177">Aktuelle Filme</string>
|
||||||
<string id="30178">Begonnene Episoden</string>
|
<string id="30178">Aktuelle Episoden</string>
|
||||||
<string id="30179">Nächste Episoden</string>
|
<string id="30179">Nächste Episoden</string>
|
||||||
<string id="30180">Favorisierte Filme</string>
|
<string id="30180">Favorisierte Filme</string>
|
||||||
<string id="30181">Favorisierte Serien</string>
|
<string id="30181">Favorisierte Serien</string>
|
||||||
|
|
|
@ -1513,7 +1513,7 @@ class API():
|
||||||
"""
|
"""
|
||||||
Returns the date when this library item was created
|
Returns the date when this library item was created
|
||||||
"""
|
"""
|
||||||
return utils.DateToKodi(self.item.attrib.get('addedAt', None))
|
return utils.DateToKodi(self.item.attrib.get('addedAt'))
|
||||||
|
|
||||||
def getUserData(self):
|
def getUserData(self):
|
||||||
"""
|
"""
|
||||||
|
@ -2044,15 +2044,15 @@ class API():
|
||||||
"""
|
"""
|
||||||
item = self.item.attrib
|
item = self.item.attrib
|
||||||
|
|
||||||
maxHeight = 10000
|
# maxHeight = 10000
|
||||||
maxWidth = 10000
|
# maxWidth = 10000
|
||||||
customquery = ""
|
# customquery = ""
|
||||||
|
|
||||||
if utils.settings('compressArt') == "true":
|
# if utils.settings('compressArt') == "true":
|
||||||
customquery = "&Quality=90"
|
# customquery = "&Quality=90"
|
||||||
|
|
||||||
if utils.settings('enableCoverArt') == "false":
|
# if utils.settings('enableCoverArt') == "false":
|
||||||
customquery += "&EnableImageEnhancers=false"
|
# customquery += "&EnableImageEnhancers=false"
|
||||||
|
|
||||||
allartworks = {
|
allartworks = {
|
||||||
'Primary': "",
|
'Primary': "",
|
||||||
|
@ -2083,54 +2083,21 @@ class API():
|
||||||
|
|
||||||
# Process parent items if the main item is missing artwork
|
# Process parent items if the main item is missing artwork
|
||||||
if parentInfo:
|
if parentInfo:
|
||||||
|
|
||||||
# Process parent backdrops
|
# Process parent backdrops
|
||||||
if not allartworks['Backdrop']:
|
if not allartworks['Backdrop']:
|
||||||
|
background = item.get('parentArt')
|
||||||
|
if background:
|
||||||
|
background = "%s%s" % (self.server, background)
|
||||||
|
background = self.addPlexCredentialsToUrl(background)
|
||||||
|
allartworks['Backdrop'].append(background)
|
||||||
|
|
||||||
parentId = item.get('ParentBackdropItemId')
|
|
||||||
if parentId:
|
|
||||||
# If there is a parentId, go through the parent backdrop list
|
|
||||||
parentbackdrops = item['ParentBackdropImageTags']
|
|
||||||
|
|
||||||
backdropIndex = 0
|
|
||||||
for parentbackdroptag in parentbackdrops:
|
|
||||||
artwork = (
|
|
||||||
"%s/emby/Items/%s/Images/Backdrop/%s?"
|
|
||||||
"MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s"
|
|
||||||
% (self.server, parentId, backdropIndex,
|
|
||||||
maxWidth, maxHeight, parentbackdroptag, customquery))
|
|
||||||
allartworks['Backdrop'].append(artwork)
|
|
||||||
backdropIndex += 1
|
|
||||||
|
|
||||||
# Process the rest of the artwork
|
|
||||||
parentartwork = ['Logo', 'Art', 'Thumb']
|
|
||||||
for parentart in parentartwork:
|
|
||||||
|
|
||||||
if not allartworks[parentart]:
|
|
||||||
|
|
||||||
parentId = item.get('Parent%sItemId' % parentart)
|
|
||||||
if parentId:
|
|
||||||
|
|
||||||
parentTag = item['Parent%sImageTag' % parentart]
|
|
||||||
artwork = (
|
|
||||||
"%s/emby/Items/%s/Images/%s/0?"
|
|
||||||
"MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s"
|
|
||||||
% (self.server, parentId, parentart,
|
|
||||||
maxWidth, maxHeight, parentTag, customquery))
|
|
||||||
allartworks[parentart] = artwork
|
|
||||||
|
|
||||||
# Parent album works a bit differently
|
|
||||||
if not allartworks['Primary']:
|
if not allartworks['Primary']:
|
||||||
|
primary = item['parentThumb']
|
||||||
|
if primary:
|
||||||
|
primary = "%s%s" % (self.server, primary)
|
||||||
|
primary = self.addPlexCredentialsToUrl(primary)
|
||||||
|
allartworks['Primary'] = primary
|
||||||
|
|
||||||
parentId = item.get('AlbumId')
|
|
||||||
if parentId and item.get('AlbumPrimaryImageTag'):
|
|
||||||
|
|
||||||
parentTag = item['AlbumPrimaryImageTag']
|
|
||||||
artwork = (
|
|
||||||
"%s/emby/Items/%s/Images/Primary/0?"
|
|
||||||
"MaxWidth=%s&MaxHeight=%s&Format=original&Tag=%s%s"
|
|
||||||
% (self.server, parentId, maxWidth, maxHeight, parentTag, customquery))
|
|
||||||
allartworks['Primary'] = artwork
|
|
||||||
return allartworks
|
return allartworks
|
||||||
|
|
||||||
def getTranscodeVideoPath(self, action, quality={}):
|
def getTranscodeVideoPath(self, action, quality={}):
|
||||||
|
|
|
@ -37,7 +37,7 @@ class DownloadUtils():
|
||||||
|
|
||||||
# Requests session
|
# Requests session
|
||||||
s = None
|
s = None
|
||||||
timeout = 10
|
timeout = 30
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class image_cache_thread(threading.Thread):
|
||||||
"http://%s:%s/image/image://%s"
|
"http://%s:%s/image/image://%s"
|
||||||
% (self.xbmc_host, self.xbmc_port, self.urlToProcess)),
|
% (self.xbmc_host, self.xbmc_port, self.urlToProcess)),
|
||||||
auth=(self.xbmc_username, self.xbmc_password),
|
auth=(self.xbmc_username, self.xbmc_password),
|
||||||
timeout=(2, 2))
|
timeout=(5, 5))
|
||||||
# We don't need the result
|
# We don't need the result
|
||||||
except: pass
|
except: pass
|
||||||
|
|
||||||
|
|
|
@ -1141,9 +1141,8 @@ class TVShows(Items):
|
||||||
# skip this item for now
|
# skip this item for now
|
||||||
return
|
return
|
||||||
|
|
||||||
def run_add_updateSeason(self, item, viewid=None, viewtag=None):
|
def run_add_updateSeason(self, item, viewtag=None, viewid=None):
|
||||||
API = PlexAPI.API(item)
|
API = PlexAPI.API(item)
|
||||||
showid = viewid
|
|
||||||
itemid = API.getRatingKey()
|
itemid = API.getRatingKey()
|
||||||
if not itemid:
|
if not itemid:
|
||||||
self.logMsg('Error getting itemid for season, skipping', -1)
|
self.logMsg('Error getting itemid for season, skipping', -1)
|
||||||
|
@ -1153,6 +1152,18 @@ class TVShows(Items):
|
||||||
kodi_db = self.kodi_db
|
kodi_db = self.kodi_db
|
||||||
artwork = self.artwork
|
artwork = self.artwork
|
||||||
seasonnum = API.getIndex()
|
seasonnum = API.getIndex()
|
||||||
|
# Get parent tv show Plex id
|
||||||
|
plexshowid = item.attrib.get('parentRatingKey')
|
||||||
|
# Get Kodi showid
|
||||||
|
emby_dbitem = emby_db.getItem_byId(plexshowid)
|
||||||
|
try:
|
||||||
|
showid = emby_dbitem[0]
|
||||||
|
except:
|
||||||
|
self.logMsg('Could not find parent tv show for season %s. '
|
||||||
|
'Skipping season for now.'
|
||||||
|
% (itemid), -1)
|
||||||
|
return
|
||||||
|
|
||||||
seasonid = kodi_db.addSeason(showid, seasonnum)
|
seasonid = kodi_db.addSeason(showid, seasonnum)
|
||||||
checksum = API.getChecksum()
|
checksum = API.getChecksum()
|
||||||
# Check whether Season already exists
|
# Check whether Season already exists
|
||||||
|
@ -1172,7 +1183,7 @@ class TVShows(Items):
|
||||||
emby_db.updateReference(itemid, checksum)
|
emby_db.updateReference(itemid, checksum)
|
||||||
else:
|
else:
|
||||||
# Create the reference in emby table
|
# Create the reference in emby table
|
||||||
emby_db.addReference(itemid, seasonid, "Season", "season", parentid=showid, checksum=checksum)
|
emby_db.addReference(itemid, seasonid, "Season", "season", parentid=viewid, checksum=checksum)
|
||||||
|
|
||||||
def add_updateEpisode(self, item, viewtag=None, viewid=None):
|
def add_updateEpisode(self, item, viewtag=None, viewid=None):
|
||||||
try:
|
try:
|
||||||
|
@ -1434,8 +1445,8 @@ class TVShows(Items):
|
||||||
people = API.getPeopleList()
|
people = API.getPeopleList()
|
||||||
kodi_db.addPeople(episodeid, people, "episode")
|
kodi_db.addPeople(episodeid, people, "episode")
|
||||||
# Process artwork
|
# Process artwork
|
||||||
artworks = API.getAllArtwork()
|
allartworks = API.getAllArtwork()
|
||||||
artwork.addOrUpdateArt(artworks['Primary'], episodeid, "episode", "thumb", kodicursor)
|
artwork.addArtwork(allartworks, episodeid, "episode", kodicursor)
|
||||||
# Process stream details
|
# Process stream details
|
||||||
streams = API.getMediaStreams()
|
streams = API.getMediaStreams()
|
||||||
kodi_db.addStreams(fileid, streams, runtime)
|
kodi_db.addStreams(fileid, streams, runtime)
|
||||||
|
|
|
@ -1218,6 +1218,10 @@ class LibrarySync(Thread):
|
||||||
# COPY for later use
|
# COPY for later use
|
||||||
allPlexTvShowsId = self.allPlexElementsId.copy()
|
allPlexTvShowsId = self.allPlexElementsId.copy()
|
||||||
|
|
||||||
|
# Process self.updatelist
|
||||||
|
self.GetAndProcessXMLs(itemType)
|
||||||
|
self.logMsg("GetAndProcessXMLs completed for tv shows", 1)
|
||||||
|
|
||||||
# PROCESS TV Seasons #####
|
# PROCESS TV Seasons #####
|
||||||
# Cycle through tv shows
|
# Cycle through tv shows
|
||||||
for tvShowId in allPlexTvShowsId:
|
for tvShowId in allPlexTvShowsId:
|
||||||
|
@ -1238,6 +1242,10 @@ class LibrarySync(Thread):
|
||||||
self.logMsg("Analyzed all seasons of TV show with Plex Id %s"
|
self.logMsg("Analyzed all seasons of TV show with Plex Id %s"
|
||||||
% tvShowId, 1)
|
% tvShowId, 1)
|
||||||
|
|
||||||
|
# Process self.updatelist
|
||||||
|
self.GetAndProcessXMLs(itemType)
|
||||||
|
self.logMsg("GetAndProcessXMLs completed for seasons", 1)
|
||||||
|
|
||||||
# PROCESS TV Episodes #####
|
# PROCESS TV Episodes #####
|
||||||
# Cycle through tv shows
|
# Cycle through tv shows
|
||||||
for view in views:
|
for view in views:
|
||||||
|
@ -1261,7 +1269,7 @@ class LibrarySync(Thread):
|
||||||
|
|
||||||
# Process self.updatelist
|
# Process self.updatelist
|
||||||
self.GetAndProcessXMLs(itemType)
|
self.GetAndProcessXMLs(itemType)
|
||||||
self.logMsg("GetAndProcessXMLs completed", 1)
|
self.logMsg("GetAndProcessXMLs completed for episodes", 1)
|
||||||
# Refresh season info
|
# Refresh season info
|
||||||
# Cycle through tv shows
|
# Cycle through tv shows
|
||||||
with itemtypes.TVShows() as TVshow:
|
with itemtypes.TVShows() as TVshow:
|
||||||
|
|
|
@ -7,7 +7,8 @@ import inspect
|
||||||
import json
|
import json
|
||||||
import pstats
|
import pstats
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from datetime import datetime, time, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
import time
|
||||||
import unicodedata
|
import unicodedata
|
||||||
import xml.etree.ElementTree as etree
|
import xml.etree.ElementTree as etree
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
@ -545,7 +546,7 @@ def startProfiling():
|
||||||
return pr
|
return pr
|
||||||
|
|
||||||
def stopProfiling(pr, profileName):
|
def stopProfiling(pr, profileName):
|
||||||
|
from datetime import time
|
||||||
pr.disable()
|
pr.disable()
|
||||||
ps = pstats.Stats(pr)
|
ps = pstats.Stats(pr)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue