Merge branch 'hotfixes'

This commit is contained in:
tomkat83 2017-08-02 20:09:55 +02:00
commit a7609ec062
10 changed files with 46 additions and 5 deletions

View file

@ -1,5 +1,5 @@
[![stable version](https://img.shields.io/badge/stable_version-1.8.6-blue.svg?maxAge=60&style=flat) ](https://dl.bintray.com/croneter/PlexKodiConnect/bin/repository.plexkodiconnect/repository.plexkodiconnect-1.0.0.zip) [![stable version](https://img.shields.io/badge/stable_version-1.8.5-blue.svg?maxAge=60&style=flat) ](https://dl.bintray.com/croneter/PlexKodiConnect/bin/repository.plexkodiconnect/repository.plexkodiconnect-1.0.0.zip)
[![beta version](https://img.shields.io/badge/beta_version-1.8.6-red.svg?maxAge=60&style=flat) ](https://dl.bintray.com/croneter/PlexKodiConnect_BETA/bin-BETA/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-1.0.0.zip) [![beta version](https://img.shields.io/badge/beta_version-1.8.7-red.svg?maxAge=60&style=flat) ](https://dl.bintray.com/croneter/PlexKodiConnect_BETA/bin-BETA/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-1.0.0.zip)
[![Installation](https://img.shields.io/badge/wiki-installation-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/Installation) [![Installation](https://img.shields.io/badge/wiki-installation-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/Installation)
[![FAQ](https://img.shields.io/badge/wiki-FAQ-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/faq) [![FAQ](https://img.shields.io/badge/wiki-FAQ-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/faq)

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" />
@ -59,7 +59,13 @@
<summary lang="da_DK">Indbygget Integration af Plex i Kodi</summary> <summary lang="da_DK">Indbygget Integration af Plex i Kodi</summary>
<description lang="da_DK">Tilslut Kodi til din Plex Media Server. Dette plugin forudsætter, at du administrere alle dine videoer med Plex (og ikke med Kodi). Du kan miste data som allerede er gemt i Kodi video og musik-databaser (dette plugin ændrer direkte i dem). Brug på eget ansvar!</description> <description lang="da_DK">Tilslut Kodi til din Plex Media Server. Dette plugin forudsætter, at du administrere alle dine videoer med Plex (og ikke med Kodi). Du kan miste data som allerede er gemt i Kodi video og musik-databaser (dette plugin ændrer direkte i dem). Brug på eget ansvar!</description>
<disclaimer lang="da_DK">Brug på eget ansvar</disclaimer> <disclaimer lang="da_DK">Brug på eget ansvar</disclaimer>
<news>version 1.8.6: <news>version 1.8.7:
- Some fixes to playstate reporting, thanks @RickDB
- Add Kodi info screen for episodes in context menu
- Fix PKC asking for trailers not working
- Fix PKC not automatically updating
version 1.8.6:
- Portuguese translation, thanks @goncalo532 - Portuguese translation, thanks @goncalo532
- Updated other translations - Updated other translations

View file

@ -1,3 +1,9 @@
version 1.8.7:
- Some fixes to playstate reporting, thanks @RickDB
- Add Kodi info screen for episodes in context menu
- Fix PKC asking for trailers not working
- Fix PKC not automatically updating
version 1.8.6: version 1.8.6:
- Portuguese translation, thanks @goncalo532 - Portuguese translation, thanks @goncalo532
- Updated other translations - Updated other translations

View file

@ -104,6 +104,11 @@ msgctxt "#30031"
msgid "I own this Plex Media Server" msgid "I own this Plex Media Server"
msgstr "Dieser Plex Media Server gehört mir" msgstr "Dieser Plex Media Server gehört mir"
# Kodi context menu entry for movie and episode information screen
msgctxt "#30032"
msgid "Information"
msgstr "Informationen"
msgctxt "#30035" msgctxt "#30035"
msgid "Number of recent Music Albums to show:" msgid "Number of recent Music Albums to show:"
msgstr "Anzahl anzuzeigender zuletzt hinzugefügter Alben:" msgstr "Anzahl anzuzeigender zuletzt hinzugefügter Alben:"

View file

@ -103,6 +103,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

@ -2534,6 +2534,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!