Merge branch 'hotfixes' into develop

This commit is contained in:
tomkat83 2017-08-02 20:01:29 +02:00
commit 583512eb89
7 changed files with 26 additions and 2 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.plexkodiconnect" name="PlexKodiConnect" version="1.8.5" provider-name="croneter">
<addon id="plugin.video.plexkodiconnect" name="PlexKodiConnect" version="1.8.7" provider-name="croneter">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.requests" version="2.3.0" />

View file

@ -128,6 +128,11 @@ msgctxt "#30031"
msgid "I own this Plex Media Server"
msgstr ""
# Kodi context menu entry for movie and episode information screen
msgctxt "#30032"
msgid "Information"
msgstr ""
msgctxt "#30035"
msgid "Number of recent Music Albums to show:"
msgstr ""

View file

@ -1468,6 +1468,12 @@ class API():
# Expensive operation
metadata['title'] = title
listItem.setInfo('video', infoLabels=metadata)
try:
# Add context menu entry for information screen
listItem.addContextMenuItems([(lang(30032), 'XBMC.Action(Info)',)])
except TypeError:
# Kodi fuck-up
pass
return listItem
def add_video_streams(self, listItem):

View file

@ -255,6 +255,11 @@ def createListItem(item, appendShowTitle=False, appendSxxExx=False):
li.setArt({'icon': 'DefaultTVShows.png'})
li.setProperty('dbid', str(item['episodeid']))
li.setProperty('fanart_image', item['art'].get('tvshow.fanart',''))
try:
li.addContextMenuItems([(lang(30032), 'XBMC.Action(Info)',)])
except TypeError:
# Kodi fuck-up
pass
for key, value in item['streamdetails'].iteritems():
for stream in value:
li.addStreamInfo(key, stream)

View file

@ -158,6 +158,12 @@ class Items(object):
# If the playback was stopped, check whether we need to increment the
# playcount. PMS won't tell us the playcount via websockets
if item['state'] in ('stopped', 'ended'):
# If offset exceeds duration skip update
if item['viewOffset'] > item['duration']:
log.error("Error while updating play state, viewOffset exceeded duration")
return
complete = float(item['viewOffset']) / float(item['duration'])
log.info('Item %s stopped with completion rate %s percent.'
'Mark item played at %s percent.'

View file

@ -92,6 +92,7 @@ class KodiMonitor(Monitor):
# Manually marking as watched/unwatched
playcount = data.get('playcount')
item = data.get('item')
try:
kodiid = item['id']
item_type = item['type']
@ -114,7 +115,7 @@ class KodiMonitor(Monitor):
window('plex_skipWatched%s' % itemid, clear=True)
else:
# notify the server
if playcount != 0:
if playcount > 0:
scrobble(itemid, 'watched')
else:
scrobble(itemid, 'unwatched')

View file

@ -129,6 +129,7 @@ class PlaybackUtils():
trailers = xbmcgui.Dialog().yesno(
lang(29999),
"Play trailers?")
trailers = True if trailers else False
else:
trailers = True
# Post to the PMS. REUSE THE PLAYQUEUE!