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"?> <?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> <requires>
<import addon="xbmc.python" version="2.1.0"/> <import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.requests" version="2.3.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" msgid "I own this Plex Media Server"
msgstr "" msgstr ""
# Kodi context menu entry for movie and episode information screen
msgctxt "#30032"
msgid "Information"
msgstr ""
msgctxt "#30035" msgctxt "#30035"
msgid "Number of recent Music Albums to show:" msgid "Number of recent Music Albums to show:"
msgstr "" msgstr ""

View file

@ -1468,6 +1468,12 @@ class API():
# Expensive operation # Expensive operation
metadata['title'] = title metadata['title'] = title
listItem.setInfo('video', infoLabels=metadata) 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 return listItem
def add_video_streams(self, 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.setArt({'icon': 'DefaultTVShows.png'})
li.setProperty('dbid', str(item['episodeid'])) li.setProperty('dbid', str(item['episodeid']))
li.setProperty('fanart_image', item['art'].get('tvshow.fanart','')) 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 key, value in item['streamdetails'].iteritems():
for stream in value: for stream in value:
li.addStreamInfo(key, stream) 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 # If the playback was stopped, check whether we need to increment the
# playcount. PMS won't tell us the playcount via websockets # playcount. PMS won't tell us the playcount via websockets
if item['state'] in ('stopped', 'ended'): 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']) complete = float(item['viewOffset']) / float(item['duration'])
log.info('Item %s stopped with completion rate %s percent.' log.info('Item %s stopped with completion rate %s percent.'
'Mark item played at %s percent.' 'Mark item played at %s percent.'

View file

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

View file

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