diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c4e4368b..095b417f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,7 @@ +# Do NOT Post Your Logs with Tokens! + +Be sure to replace all tokens from your log files before posting, otherwise anyone may access your Plex Media Server! Be sure to read [the guideline](https://github.com/croneter/PlexKodiConnect/wiki/How-to-Report-A-Bug) + # How to contribute Thanks a ton for contributing to PlexKodiConnect! diff --git a/README.md b/README.md index 53854fde..dbae4777 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![stable version](https://img.shields.io/badge/stable_version-1.8.1-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.1-red.svg?maxAge=60&style=flat) ](https://dl.bintray.com/croneter/PlexKodiConnect_BETA/bin-BETA/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-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.5-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) [![FAQ](https://img.shields.io/badge/wiki-FAQ-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/faq) @@ -60,13 +60,15 @@ PKC synchronizes your media from your Plex server to the native Kodi database. H + English + German + Czech, thanks @Pavuucek - + Spanish, thanks @bartolomesoriano + + Spanish, thanks @bartolomesoriano, @danichispa + Danish, thanks @FIGHT + Italian, thanks @nikkux, @chicco83 + Dutch, thanks @mvanbaak - + French, thanks @lflforce, @ahivert, @Nox71, @CotzaDev, @vinch100, @Polymorph31, @jbnitro + + French, thanks @lflforce, @ahivert, @Nox71, @CotzaDev, @vinch100, @Polymorph31, @jbnitro, @Elixir59 + Chinese Traditional, thanks @old2tan + Chinese Simplified, thanks @everdream + + Norwegian, thanks @mjorud + + Portuguese, thanks @goncalo532 + [Please help translating](https://www.transifex.com/croneter/pkc) ### Download and Installation diff --git a/addon.xml b/addon.xml index f24edd75..105a8729 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -24,27 +24,67 @@ https://github.com/croneter/PlexKodiConnect Native Integration of Plex into Kodi - Úplná integrace Plexu do Kodi - Komplette Integration von Plex in Kodi - Indbygget Integration af Plex i Kodi - Directe integratie van Plex in Kodi - 將Plex直接內嵌至Kodi - Integración Nativa de Plex en Kodi Connect Kodi to your Plex Media Server. This plugin assumes that you manage all your videos with Plex (and none with Kodi). You might lose data already stored in the Kodi video and music databases (as this plugin directly changes them). Use at your own risk! - Připojte Kodi ke svému Plex Media Serveru. Tento doplněk předpokládá, že spravujete veškerá svá videa pomocí Plexu (nikoliv pomocí Kodi). Můžete přijít o data uložená ve video a hudební databázi Kodi (tento doplněk je přímo mění). - Verbindet Kodi mit deinem Plex Media Server. Dieses Addon geht davon aus, dass du all deine Videos mit Plex verwaltest (und keine direkt mit Kodi). Du wirst möglicherweise Daten verlieren, die bereits in der Kodi Video- und/oder Musik-Datenbank gespeichert sind (da dieses Addon beide Datenbanken direkt verändert). - 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). - Verbind Kodi met je Plex Media Server. Deze plugin gaat ervan uit dat je al je video's met Plex (en niet met Kodi) beheerd. Je kunt gegevens reeds opgeslagen in de databases voor video en muziek van Kodi (deze plugin wijzigt deze gegevens direct) verliezen. - 連接Kodi至您的Plex媒體伺服器.這個外掛程式假設你使用Plex伺服器管理您所有的媒體(完全沒用Kodi管理).您可能會失去已經儲存在Kodi資料庫中的視頻及音樂的資料(這個外掛程式會直接更改它們). - Conecte Kodi a su Plex Media Server. Este plugin asume que usted gestiona todos sus vídeos con Plex (y ninguno con Kodi). Puede perder datos ya guardados en las bases de datos de vídeo y música de Kodi (ya que este plugin las actualiza directamente). ¡Úselo a su propio riesgo! Use at your own risk - Používejte na vlastní nebezpečí - Benutze auf eigene Gefahr - Brug på eget ansvar + Directe integratie van Plex in Kodi + Verbind Kodi met je Plex Media Server. Deze plugin gaat ervan uit dat je al je video's met Plex (en niet met Kodi) beheerd. Je kunt gegevens reeds opgeslagen in de databases voor video en muziek van Kodi (deze plugin wijzigt deze gegevens direct) verliezen. Gebruik op eigen risico! Gebruik op eigen risico - 使用風險由您自己承擔 + Intégration native de Plex dans Kodi + Connecter Kodi à votre Plex Media Server. Ce plugin assume que vous souhaitez gérer toutes vos vidéos avec Plex (et aucune avec Kodi). Vous pourriez perdre les données déjà stockées dans les bases de données vidéo et musique de Kodi (ce plugin les modifie directement). Utilisez à vos propres risques ! + A utiliser à vos propres risques + Intégration native de Plex dans Kodi + Connecter Kodi à votre Plex Media Server. Ce plugin assume que vous souhaitez gérer toutes vos vidéos avec Plex (et aucune avec Kodi). Vous pourriez perdre les données déjà stockées dans les bases de données vidéo et musique de Kodi (ce plugin les modifie directement). Utilisez à vos propres risques ! + A utiliser à vos propres risques + Komplette Integration von Plex in Kodi + Verbindet Kodi mit deinem Plex Media Server. Dieses Addon geht davon aus, dass du all deine Videos mit Plex verwaltest (und keine direkt mit Kodi). Du wirst möglicherweise Daten verlieren, die bereits in der Kodi Video- und/oder Musik-Datenbank gespeichert sind (da dieses Addon beide Datenbanken direkt verändert). Verwendung auf eigene Gefahr! + Verwendung auf eigene Gefahr + Integração nativa do Plex no Kodi + Conectar o Kodi ao Servidor Plex Media. Este plugin assume que gerirá todos os vídeos com o Plex (e nenhum com Kodi). Poderá perder dados guardados nas bases de dados de vídeo e musica do Kodi (pois este plugin interfere diretamente com as mesmas). Use por risco de conta própria + Use por risco de conta própria + Integração nativa do Plex no Kodi + Conectar o Kodi ao Servidor Plex Media. Este plugin assume que gerirá todos os vídeos com o Plex (e nenhum com Kodi). Poderá perder dados guardados nas bases de dados de vídeo e musica do Kodi (pois este plugin interfere diretamente com as mesmas). Use por risco de conta própria + Use por risco de conta própria + Integración Nativa de Plex en Kodi + Conecte Kodi a su Plex Media Server. Este plugin asume que usted gestiona todos sus vídeos con Plex (y ninguno con Kodi). Puede perder datos ya guardados en las bases de datos de vídeo y música de Kodi (ya que este plugin las actualiza directamente). ¡Úselo a su propio riesgo! Usar a su propio riesgo - version 1.8.1: + Integración Nativa de Plex en Kodi + Conecte Kodi a su Plex Media Server. Este plugin asume que usted gestiona todos sus vídeos con Plex (y ninguno con Kodi). Puede perder datos ya guardados en las bases de datos de vídeo y música de Kodi (ya que este plugin las actualiza directamente). ¡Úselo a su propio riesgo! + Usar a su propio riesgo + Integración Nativa de Plex en Kodi + Conecte Kodi a su Plex Media Server. Este plugin asume que usted gestiona todos sus vídeos con Plex (y ninguno con Kodi). Puede perder datos ya guardados en las bases de datos de vídeo y música de Kodi (ya que este plugin las actualiza directamente). ¡Úselo a su propio riesgo! + Usar a su propio riesgo + Úplná integrace Plexu do Kodi + Připojte Kodi ke svému Plex Media Serveru. Tento doplněk předpokládá, že spravujete veškerá svá videa pomocí Plexu (nikoliv pomocí Kodi). Můžete přijít o data uložená ve video a hudební databázi Kodi (tento doplněk je přímo mění). Používejte na vlastní nebezpečí! + Používejte na vlastní nebezpečí + Indbygget Integration af Plex i Kodi + 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! + Brug på eget ansvar + version 1.8.6: +- Portuguese translation, thanks @goncalo532 +- Updated other translations + +version 1.8.5: +- version 1.8.4 for everyone + +version 1.8.5: +- version 1.8.4 for everyone + +version 1.8.4 (beta only): +- Plex cloud should now work: Request pictures with transcoding API +- Fix Plex companion feedback for Android +- Update translations + +version 1.8.3: +- Fix Kodi playlists being empty + +version 1.8.2: +- Choose to replace user ratings with the number of available versions of a media file +- More collection artwork: use TheMovieDB art +- Support new Companion command "refreshPlayQueue" +- Use https for TheMovieDB +- Update translations + +version 1.8.1: - Fix library sync crash due to UnicodeDecodeError - Fix fanart for collections - Comply with themoviedb.org terms of use diff --git a/changelog.txt b/changelog.txt index 8f7b807d..d59f84f0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,25 @@ +version 1.8.6: +- Portuguese translation, thanks @goncalo532 +- Updated other translations + +version 1.8.5: +- version 1.8.4 for everyone + +version 1.8.4 (beta only): +- Plex cloud should now work: Request pictures with transcoding API +- Fix Plex companion feedback for Android +- Update translations + +version 1.8.3: +- Fix Kodi playlists being empty + +version 1.8.2: +- Choose to replace user ratings with the number of available versions of a media file +- More collection artwork: use TheMovieDB art +- Support new Companion command "refreshPlayQueue" +- Use https for TheMovieDB +- Update translations + version 1.8.1: - Fix library sync crash due to UnicodeDecodeError - Fix fanart for collections @@ -676,7 +698,7 @@ version 1.0.17 version 1.0.16 - Kodi profiles up and running; try assigning different Plex users per profile! -- Change "Switch User" to "Log Out Plex User: " +- Change "Switch User" to "Log Out Plex User: username" - TV shows On Deck: append season and episode number in the settings - Shut down PKC correctly (useful for Kodi profiles) - Don't de-authorize if several PMS are present diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 6a5d051c..a2297406 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -83,6 +83,11 @@ msgctxt "#30017" msgid "Unauthorized for PMS" msgstr "" +# Kodi context menu entry for movie and episode information screen +msgctxt "#30018" +msgid "Information" +msgstr "" + msgctxt "#30022" msgid "Advanced" msgstr "" diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index 03f360f6..930c2e1c 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -1806,15 +1806,14 @@ class API(): } def __getOneArtwork(self, entry): - try: - artwork = self.item.attrib[entry] - if artwork.startswith('http'): - pass - else: - artwork = "%s%s" % (self.server, artwork) - artwork = self.addPlexCredentialsToUrl(artwork) - except KeyError: - artwork = "" + if entry not in self.item.attrib: + return '' + artwork = self.item.attrib[entry] + if artwork.startswith('http'): + pass + else: + artwork = self.addPlexCredentialsToUrl( + "%s/photo/:/transcode?width=4000&height=4000&minSize=1&upscale=0&url=%s" % (self.server, artwork)) return artwork def getAllArtwork(self, parentInfo=False): @@ -2535,6 +2534,12 @@ class API(): # Expensive operation metadata['title'] = title listItem.setInfo('video', infoLabels=metadata) + try: + # Add context menu entry for information screen + listItem.addContextMenuItems([(lang(30018), 'XBMC.Action(Info)',)]) + except TypeError: + # Kodi fuck-up + pass return listItem def add_video_streams(self, listItem): diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index eaf360fb..2c83ba1d 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -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(30018), 'XBMC.Action(Info)',)]) + except TypeError: + # Kodi fuck-up + pass for key, value in item['streamdetails'].iteritems(): for stream in value: li.addStreamInfo(key, stream) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 4cfa311a..f244844b 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -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.' diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 579c9033..fde49a13 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -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') diff --git a/resources/lib/playbackutils.py b/resources/lib/playbackutils.py index 1ca853d4..388b0dc5 100644 --- a/resources/lib/playbackutils.py +++ b/resources/lib/playbackutils.py @@ -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! diff --git a/resources/lib/plexbmchelper/subscribers.py b/resources/lib/plexbmchelper/subscribers.py index dcee3e57..9e936f05 100644 --- a/resources/lib/plexbmchelper/subscribers.py +++ b/resources/lib/plexbmchelper/subscribers.py @@ -58,7 +58,7 @@ class SubscriptionManager: def msg(self, players): msg = getXMLHeader() msg += '\n' '\n\t' 'Plex %s\n\t' @@ -908,9 +909,10 @@ def playlistXSP(mediatype, tagname, viewid, viewtype="", delete=False): '%s\n\t' '\n' '\n' - % (itemtypes.get(mediatype, mediatype), plname, tagname)) + % (itemtypes.get(mediatype, mediatype), plname, tagname))) log.info("Successfully added playlist: %s" % tagname) + def deletePlaylists(): # Clean up the playlists path = tryDecode(xbmc.translatePath("special://profile/playlists/video/"))