From 0e421d16e3d7c2db3bb8fe6a452cb468cbec9d56 Mon Sep 17 00:00:00 2001 From: Croneter Date: Sun, 29 Apr 2018 14:59:04 +0200 Subject: [PATCH 01/19] Pull latest transifex translations --- .../resource.language.cs_CZ/strings.po | 20 +++++++++++++++++++ .../resource.language.da_DK/strings.po | 20 +++++++++++++++++++ .../resource.language.de_DE/strings.po | 20 +++++++++++++++++++ .../resource.language.es_AR/strings.po | 20 +++++++++++++++++++ .../resource.language.es_ES/strings.po | 20 +++++++++++++++++++ .../resource.language.es_MX/strings.po | 20 +++++++++++++++++++ .../resource.language.fr_CA/strings.po | 20 +++++++++++++++++++ .../resource.language.fr_FR/strings.po | 20 +++++++++++++++++++ .../resource.language.hu_HU/strings.po | 20 +++++++++++++++++++ .../resource.language.it_IT/strings.po | 20 +++++++++++++++++++ .../resource.language.nl_NL/strings.po | 20 +++++++++++++++++++ .../resource.language.no_NO/strings.po | 20 +++++++++++++++++++ .../resource.language.pt_BR/strings.po | 20 +++++++++++++++++++ .../resource.language.pt_PT/strings.po | 20 +++++++++++++++++++ .../resource.language.ru_RU/strings.po | 20 +++++++++++++++++++ .../resource.language.zh_CN/strings.po | 20 +++++++++++++++++++ .../resource.language.zh_TW/strings.po | 20 +++++++++++++++++++ 17 files changed, 340 insertions(+) diff --git a/resources/language/resource.language.cs_CZ/strings.po b/resources/language/resource.language.cs_CZ/strings.po index f7f3f4e4..0bb39dd3 100644 --- a/resources/language/resource.language.cs_CZ/strings.po +++ b/resources/language/resource.language.cs_CZ/strings.po @@ -48,6 +48,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Uživ. jméno: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.da_DK/strings.po b/resources/language/resource.language.da_DK/strings.po index 0d8b8f92..1c0be2fd 100644 --- a/resources/language/resource.language.da_DK/strings.po +++ b/resources/language/resource.language.da_DK/strings.po @@ -45,6 +45,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Brugernavn: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.de_DE/strings.po b/resources/language/resource.language.de_DE/strings.po index d697d746..c60251bc 100644 --- a/resources/language/resource.language.de_DE/strings.po +++ b/resources/language/resource.language.de_DE/strings.po @@ -47,6 +47,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Benutzername: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "Cache %s Bilder" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "Cachen wichtigster Bilder beendet" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "Benachrichtigungen für Cachen von Bildern aktivieren" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "Cachen von Bildern während Wiedergabe aktivieren (Kodi neu starten!)" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.es_AR/strings.po b/resources/language/resource.language.es_AR/strings.po index 635ba860..4e21bab0 100644 --- a/resources/language/resource.language.es_AR/strings.po +++ b/resources/language/resource.language.es_AR/strings.po @@ -45,6 +45,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Usuario: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.es_ES/strings.po b/resources/language/resource.language.es_ES/strings.po index e500e980..5af3cf56 100644 --- a/resources/language/resource.language.es_ES/strings.po +++ b/resources/language/resource.language.es_ES/strings.po @@ -45,6 +45,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Usuario: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.es_MX/strings.po b/resources/language/resource.language.es_MX/strings.po index a0c152e1..0852b06a 100644 --- a/resources/language/resource.language.es_MX/strings.po +++ b/resources/language/resource.language.es_MX/strings.po @@ -45,6 +45,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Usuario: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.fr_CA/strings.po b/resources/language/resource.language.fr_CA/strings.po index 1cc2a0a0..7af852a7 100644 --- a/resources/language/resource.language.fr_CA/strings.po +++ b/resources/language/resource.language.fr_CA/strings.po @@ -48,6 +48,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Identifiant : " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.fr_FR/strings.po b/resources/language/resource.language.fr_FR/strings.po index 6b64ea0e..f723d311 100644 --- a/resources/language/resource.language.fr_FR/strings.po +++ b/resources/language/resource.language.fr_FR/strings.po @@ -50,6 +50,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Identifiant : " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.hu_HU/strings.po b/resources/language/resource.language.hu_HU/strings.po index f20ae075..094bbea6 100644 --- a/resources/language/resource.language.hu_HU/strings.po +++ b/resources/language/resource.language.hu_HU/strings.po @@ -47,6 +47,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Felhasználónév: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.it_IT/strings.po b/resources/language/resource.language.it_IT/strings.po index 28953920..bbde46fe 100644 --- a/resources/language/resource.language.it_IT/strings.po +++ b/resources/language/resource.language.it_IT/strings.po @@ -45,6 +45,26 @@ msgctxt "#30005" msgid "Username: " msgstr "" +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.nl_NL/strings.po b/resources/language/resource.language.nl_NL/strings.po index 66cf61a8..3d493f82 100644 --- a/resources/language/resource.language.nl_NL/strings.po +++ b/resources/language/resource.language.nl_NL/strings.po @@ -48,6 +48,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Gebruikersnaam: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.no_NO/strings.po b/resources/language/resource.language.no_NO/strings.po index c4663e5a..e68cd915 100644 --- a/resources/language/resource.language.no_NO/strings.po +++ b/resources/language/resource.language.no_NO/strings.po @@ -46,6 +46,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Brukernavn:" +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.pt_BR/strings.po b/resources/language/resource.language.pt_BR/strings.po index c2f48c0a..b1cf12a8 100644 --- a/resources/language/resource.language.pt_BR/strings.po +++ b/resources/language/resource.language.pt_BR/strings.po @@ -45,6 +45,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Utilizador: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.pt_PT/strings.po b/resources/language/resource.language.pt_PT/strings.po index 24c0b081..110ad0ec 100644 --- a/resources/language/resource.language.pt_PT/strings.po +++ b/resources/language/resource.language.pt_PT/strings.po @@ -47,6 +47,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Utilizador: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.ru_RU/strings.po b/resources/language/resource.language.ru_RU/strings.po index f892d988..53596114 100644 --- a/resources/language/resource.language.ru_RU/strings.po +++ b/resources/language/resource.language.ru_RU/strings.po @@ -51,6 +51,26 @@ msgctxt "#30005" msgid "Username: " msgstr "Имя пользователя: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.zh_CN/strings.po b/resources/language/resource.language.zh_CN/strings.po index 5ae06eb3..79127bd0 100644 --- a/resources/language/resource.language.zh_CN/strings.po +++ b/resources/language/resource.language.zh_CN/strings.po @@ -46,6 +46,26 @@ msgctxt "#30005" msgid "Username: " msgstr "用户名 " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" diff --git a/resources/language/resource.language.zh_TW/strings.po b/resources/language/resource.language.zh_TW/strings.po index d3efb4c2..3f3d3755 100644 --- a/resources/language/resource.language.zh_TW/strings.po +++ b/resources/language/resource.language.zh_TW/strings.po @@ -45,6 +45,26 @@ msgctxt "#30005" msgid "Username: " msgstr "使用者: " +# Sync notification displayed if there is still artwork to be cached to Kodi +msgctxt "#30006" +msgid "Caching %s images" +msgstr "" + +# Sync notification displayed if syncing of major artwork is done +msgctxt "#30007" +msgid "Major image caching done" +msgstr "" + +# PKC settings artwork: Enable notifications for artwork image sync +msgctxt "#30008" +msgid "Enable notifications for image caching" +msgstr "" + +# PKC settings artwork: Enable image caching during Kodi playback +msgctxt "#30009" +msgid "Enable image caching during Kodi playback (restart Kodi!)" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" From 9b5dfac3a6059182386ae9567593f3b846190df8 Mon Sep 17 00:00:00 2001 From: Croneter Date: Sun, 29 Apr 2018 15:10:21 +0200 Subject: [PATCH 02/19] Version bump --- README.md | 2 +- addon.xml | 11 +++++++++-- changelog.txt | 7 +++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index efd5e0bb..4cd200a9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![stable version](https://img.shields.io/badge/stable_version-1.8.18-blue.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/stable/repository.plexkodiconnect/repository.plexkodiconnect-1.0.2.zip) -[![beta version](https://img.shields.io/badge/beta_version-2.0.20-red.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/beta/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-1.0.2.zip) +[![beta version](https://img.shields.io/badge/beta_version-2.0.21-red.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/beta/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-1.0.2.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) diff --git a/addon.xml b/addon.xml index d1b93556..d0e18b86 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -67,7 +67,14 @@ Нативная интеграция сервера Plex в Kodi Подключите Kodi к своему серверу Plex. Плагин предполагает что вы управляете своими видео с помощью Plex (а не в Kodi). Вы можете потерять текущие базы данных музыки и видео в Kodi (так как плагин напрямую их изменяет). Используйте на свой страх и риск Используйте на свой страх и риск - version 2.0.20 (beta only): + version 2.0.21 (beta only): +- Fix TV show artwork Kodi native library (reset Kodi DB!) +- Cache missing posters and backgrounds/fanart on Kodi startup +- Add toggle to deactivate image caching during playback +- Increase timeout between syncing images +- Fix music database if new music is added in the background + +version 2.0.20 (beta only): - Fix missing episode poster in certain views. You will have to manually reset your Kodi database to benefit - Fix episode artwork sometimes not being complete - Fix IndexError for certain Plex channels diff --git a/changelog.txt b/changelog.txt index 3e401c76..c6eeb344 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +version 2.0.21 (beta only): +- Fix TV show artwork Kodi native library (reset Kodi DB!) +- Cache missing posters and backgrounds/fanart on Kodi startup +- Add toggle to deactivate image caching during playback +- Increase timeout between syncing images +- Fix music database if new music is added in the background + version 2.0.20 (beta only): - Fix missing episode poster in certain views. You will have to manually reset your Kodi database to benefit - Fix episode artwork sometimes not being complete From e1c7ab5b04f8efb41164ed9254f9ab8d8cd7f665 Mon Sep 17 00:00:00 2001 From: Croneter Date: Mon, 30 Apr 2018 14:16:45 +0200 Subject: [PATCH 03/19] PEP8 --- resources/lib/artwork.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/artwork.py b/resources/lib/artwork.py index 84d7b612..8b58fdde 100644 --- a/resources/lib/artwork.py +++ b/resources/lib/artwork.py @@ -12,8 +12,8 @@ import requests from xbmc import sleep, translatePath from xbmcvfs import exists -from utils import window, settings, language as lang, kodi_sql, try_encode, \ - thread_methods, dialog, exists_dir, try_decode +from utils import settings, language as lang, kodi_sql, try_encode, try_decode,\ + thread_methods, dialog, exists_dir import state ############################################################################### @@ -107,7 +107,7 @@ class Image_Cache_Thread(Thread): 'over-loaded. Sleep %s seconds before trying ' 'again to download %s', 2**sleeptime, double_urldecode(url)) - sleep((2**sleeptime)*1000) + sleep((2**sleeptime) * 1000) sleeptime += 1 continue except Exception as e: From 952261fb5a9b443c7b071ef4208ae6e97b977d0d Mon Sep 17 00:00:00 2001 From: Croneter Date: Mon, 30 Apr 2018 14:18:14 +0200 Subject: [PATCH 04/19] Add some comments --- resources/lib/artwork.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/lib/artwork.py b/resources/lib/artwork.py index 8b58fdde..5ab1199c 100644 --- a/resources/lib/artwork.py +++ b/resources/lib/artwork.py @@ -162,9 +162,11 @@ class Artwork(): return LOG.info('Caching has not been completed - caching %s major images', len(artworks_to_cache)) + # Caching %s images self.queue.put(ArtworkSyncMessage(lang(30006) % len(artworks_to_cache))) for url in artworks_to_cache: self.queue.put(url[0]) + # Major image caching done self.queue.put(ArtworkSyncMessage(lang(30007))) def fullTextureCacheSync(self): From b357f43e7919a028d50f1fb052811b5dd43c896a Mon Sep 17 00:00:00 2001 From: Croneter Date: Wed, 2 May 2018 19:15:55 +0200 Subject: [PATCH 05/19] Revert "Use list instead of set" This reverts commit 5cea57e935c98607ec1894f4fa669c8a7b67e38c. Fixes #460 Fixes #458 --- resources/lib/entrypoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index 7ec66d72..1bd5318e 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -369,7 +369,7 @@ def getRecentEpisodes(viewid, mediatype, tagname, limit): append_show_title = settings('RecentTvAppendShow') == 'true' append_sxxexx = settings('RecentTvAppendSeason') == 'true' # First we get a list of all the TV shows - filtered by tag - allshowsIds = list() + allshowsIds = set() params = { 'sort': {'order': "descending", 'method': "dateadded"}, 'filter': {'operator': "is", 'field': "tag", 'value': "%s" % tagname}, From aa1afba4177f513b4dc59fc4b09800f5a852b87d Mon Sep 17 00:00:00 2001 From: Croneter Date: Wed, 2 May 2018 20:00:53 +0200 Subject: [PATCH 06/19] Version bump --- README.md | 2 +- addon.xml | 8 ++++++-- changelog.txt | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4cd200a9..210e9e46 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![stable version](https://img.shields.io/badge/stable_version-1.8.18-blue.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/stable/repository.plexkodiconnect/repository.plexkodiconnect-1.0.2.zip) -[![beta version](https://img.shields.io/badge/beta_version-2.0.21-red.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/beta/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-1.0.2.zip) +[![beta version](https://img.shields.io/badge/beta_version-2.0.22-red.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/beta/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-1.0.2.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) diff --git a/addon.xml b/addon.xml index d0e18b86..a13db1b9 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -67,7 +67,11 @@ Нативная интеграция сервера Plex в Kodi Подключите Kodi к своему серверу Plex. Плагин предполагает что вы управляете своими видео с помощью Plex (а не в Kodi). Вы можете потерять текущие базы данных музыки и видео в Kodi (так как плагин напрямую их изменяет). Используйте на свой страх и риск Используйте на свой страх и риск - version 2.0.21 (beta only): + version 2.0.22 (beta only): +- Fix Recently Added for tv shows not working +- Fix PKC crashing on startup + +version 2.0.21 (beta only): - Fix TV show artwork Kodi native library (reset Kodi DB!) - Cache missing posters and backgrounds/fanart on Kodi startup - Add toggle to deactivate image caching during playback diff --git a/changelog.txt b/changelog.txt index c6eeb344..6d5b8e35 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +version 2.0.22 (beta only): +- Fix Recently Added for tv shows not working +- Fix PKC crashing on startup + version 2.0.21 (beta only): - Fix TV show artwork Kodi native library (reset Kodi DB!) - Cache missing posters and backgrounds/fanart on Kodi startup From ce29f5a60e24f50157ab2b5783cf10cafb94e749 Mon Sep 17 00:00:00 2001 From: Croneter Date: Fri, 4 May 2018 15:11:18 +0200 Subject: [PATCH 07/19] Fix ValueError for third party add-ons calling PKC --- resources/lib/playback_starter.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/lib/playback_starter.py b/resources/lib/playback_starter.py index f3723b46..86433bcd 100644 --- a/resources/lib/playback_starter.py +++ b/resources/lib/playback_starter.py @@ -24,7 +24,13 @@ class PlaybackStarter(Thread): """ @staticmethod def _triage(item): - _, params = item.split('?', 1) + try: + _, params = item.split('?', 1) + except ValueError: + # E.g. other add-ons scanning for Extras folder + LOG.debug('Detected 3rd party add-on call - ignoring') + pickle_me(Playback_Successful()) + return params = dict(parse_qsl(params)) mode = params.get('mode') resolve = False if params.get('handle') == '-1' else True From 63f7d5615dbecba4ebb9af00d58d96bde2f435e3 Mon Sep 17 00:00:00 2001 From: Croneter Date: Fri, 4 May 2018 19:03:27 +0200 Subject: [PATCH 08/19] Finally support for Extras! --- default.py | 3 +++ resources/lib/PlexAPI.py | 39 ++++++++++++++++++++++++++++ resources/lib/context_entry.py | 46 +++++++++++++++++++++++++++------- resources/lib/entrypoint.py | 20 +++++++++++++++ 4 files changed, 99 insertions(+), 9 deletions(-) diff --git a/default.py b/default.py index 79b07fb3..1aaee286 100644 --- a/default.py +++ b/default.py @@ -99,6 +99,9 @@ class Main(): elif mode == 'channels': entrypoint.channels() + elif mode == 'extras': + entrypoint.extras(plex_id=params.get('plex_id')) + elif mode == 'settings': executebuiltin('Addon.OpenSettings(%s)' % v.ADDON_ID) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index 03b9767e..6b0a36fa 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -99,6 +99,35 @@ class API(object): """ return self.item.get('ratingKey') + def path(self, force_first_media=True): + """ + Returns a "fully qualified path": add-on paths or direct paths + depending on the current settings. Will NOT valide the playurl + Returns unicode or None if something went wrong. + """ + filename = self.file_path(force_first_media=force_first_media) + if not state.DIRECT_PATHS or self.plex_type() == v.PLEX_TYPE_CLIP: + if filename and '/' in filename: + filename = filename.rsplit('/', 1) + elif filename: + filename = filename.rsplit('\\', 1) + try: + filename = filename[1] + except (TypeError, IndexError): + filename = None + # Set plugin path and media flags using real filename + path = ('plugin://%s/?plex_id=%s&plex_type=%s&mode=play&filename=%s' + % (v.ADDON_TYPE[self.plex_type()], + self.plex_id(), + self.plex_type(), + filename)) + else: + # Direct paths is set the Kodi way + path = self.validate_playurl(filename, + self.plex_type(), + omit_check=True) + return path + def path_and_plex_id(self): """ Returns the Plex key such as '/library/metadata/246922' or None @@ -655,6 +684,16 @@ class API(object): answ['bitDepth'] = None return answ + def extras(self): + """ + Returns a list of XML etree elements for each extra, e.g. a trailer. + """ + answ = [] + for extras in self.item.iterfind('Extras'): + for extra in extras: + answ.append(extra) + return answ + def trailer_id(self): """ Returns the ratingKey (plex_id) of the trailer or None diff --git a/resources/lib/context_entry.py b/resources/lib/context_entry.py index 56d2f2b1..fa5fd414 100644 --- a/resources/lib/context_entry.py +++ b/resources/lib/context_entry.py @@ -2,13 +2,16 @@ ############################################################################### from logging import getLogger -from xbmc import getInfoLabel, sleep, executebuiltin from xbmcaddon import Addon +import xbmc +import xbmcplugin +import xbmcgui import plexdb_functions as plexdb from utils import window, settings, dialog, language as lang from dialogs import context -from PlexFunctions import delete_item_from_pms +import PlexFunctions as PF +from PlexAPI import API import playqueue as PQ import variables as v import state @@ -25,7 +28,8 @@ OPTIONS = { # 'RemoveFav': lang(30406), # 'RateSong': lang(30407), 'Transcode': lang(30412), - 'PMS_Play': lang(30415) # Use PMS to start playback + 'PMS_Play': lang(30415), # Use PMS to start playback + 'Extras': lang(30235) } ############################################################################### @@ -53,17 +57,24 @@ class ContextMenu(object): self.plex_id, self.plex_type) if not self.plex_id: return + xml = PF.GetPlexMetadata(self.plex_id) + try: + xml[0].attrib + except (TypeError, IndexError, KeyError): + self.api = None + else: + self.api = API(xml[0]) if self._select_menu(): self._action_menu() if self._selected_option in (OPTIONS['Delete'], OPTIONS['Refresh']): LOG.info("refreshing container") - sleep(500) - executebuiltin('Container.Refresh') + xbmc.sleep(500) + xbmc.executebuiltin('Container.Refresh') @staticmethod def _get_plex_id(kodi_id, kodi_type): - plex_id = getInfoLabel('ListItem.Property(plexid)') or None + plex_id = xbmc.getInfoLabel('ListItem.Property(plexid)') or None if not plex_id and kodi_id and kodi_type: with plexdb.Get_Plex_DB() as plexcursor: item = plexcursor.getItem_byKodiId(kodi_id, kodi_type) @@ -79,6 +90,8 @@ class ContextMenu(object): """ options = [] # if user uses direct paths, give option to initiate playback via PMS + if self.api and self.api.extras(): + options.append(OPTIONS['Extras']) if state.DIRECT_PATHS and self.kodi_type in v.KODI_VIDEOTYPES: options.append(OPTIONS['PMS_Play']) if self.kodi_type in v.KODI_VIDEOTYPES: @@ -122,6 +135,8 @@ class ContextMenu(object): self._PMS_play() elif selected == OPTIONS['PMS_Play']: self._PMS_play() + elif selected == OPTIONS['Extras']: + self._extras() # elif selected == OPTIONS['Refresh']: # self.emby.refreshItem(self.item_id) # elif selected == OPTIONS['AddFav']: @@ -131,7 +146,8 @@ class ContextMenu(object): # elif selected == OPTIONS['RateSong']: # self._rate_song() elif selected == OPTIONS['Addon']: - executebuiltin('Addon.OpenSettings(plugin.video.plexkodiconnect)') + xbmc.executebuiltin( + 'Addon.OpenSettings(plugin.video.plexkodiconnect)') elif selected == OPTIONS['Delete']: self._delete_item() @@ -146,7 +162,7 @@ class ContextMenu(object): delete = False if delete: LOG.info("Deleting Plex item with id %s", self.plex_id) - if delete_item_from_pms(self.plex_id) is False: + if PF.delete_item_from_pms(self.plex_id) is False: dialog("ok", heading="{plex}", line1=lang(30414)) def _PMS_play(self): @@ -161,4 +177,16 @@ class ContextMenu(object): % (v.ADDON_TYPE[self.plex_type], self.plex_id, self.plex_type)) - executebuiltin('RunPlugin(%s)' % handle) + xbmc.executebuiltin('RunPlugin(%s)' % handle) + + def _extras(self): + """ + Displays a list of elements for all the extras of the Plex element + """ + handle = ('plugin://plugin.video.plexkodiconnect?mode=extras&plex_id=%s' + % self.plex_id) + if xbmcgui.getCurrentWindowId() == 10025: + # Video Window + xbmc.executebuiltin('Container.Update(\"%s\")' % handle) + else: + xbmc.executebuiltin('ActivateWindow(videos, \"%s\")' % handle) diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index 1bd5318e..1f47c87b 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -841,6 +841,26 @@ def __build_item(xml_element): listitem=listitem) +def extras(plex_id): + """ + Lists all extras for plex_id + """ + xbmcplugin.setContent(HANDLE, 'movies') + xml = GetPlexMetadata(plex_id) + try: + xml[0].attrib + except (TypeError, IndexError, KeyError): + xbmcplugin.endOfDirectory(HANDLE) + return + for item in API(xml[0]).extras(): + api = API(item) + listitem = api.create_listitem() + xbmcplugin.addDirectoryItem(handle=HANDLE, + url=api.path(), + listitem=listitem) + xbmcplugin.endOfDirectory(HANDLE) + + def enterPMS(): """ Opens dialogs for the user the plug in the PMS details From 7e53932cc3663533092c21c8a577234ccab42694 Mon Sep 17 00:00:00 2001 From: Croneter Date: Fri, 4 May 2018 19:06:59 +0200 Subject: [PATCH 09/19] Update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 210e9e46..7390c4c5 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ Some people argue that PKC is 'hacky' because of the way it directly accesses th - Support of Kodi 18 Leia (and Kodi 17 Krypton) - [Amazon Alexa voice recognition](https://www.plex.tv/apps/streaming-devices/amazon-alexa) +- [Cinema Trailers & Extras](https://support.plex.tv/articles/202934883-cinema-trailers-extras/) - [Plex Watch Later / Plex It!](https://support.plex.tv/hc/en-us/sections/200211783-Plex-It-) - [Plex Companion](https://support.plex.tv/hc/en-us/sections/200276908-Plex-Companion): fling Plex media (or anything else) from other Plex devices to PlexKodiConnect - [Plex Transcoding](https://support.plex.tv/hc/en-us/articles/200250377-Transcoding-Media) From 8d76bc53e5af082365fa8698510cb65c6955dbb7 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 13 May 2018 12:31:54 +0200 Subject: [PATCH 10/19] Fix rare library sync errors - Fixes #462 --- resources/lib/kodidb_functions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/lib/kodidb_functions.py b/resources/lib/kodidb_functions.py index 36edad66..c45df6e4 100644 --- a/resources/lib/kodidb_functions.py +++ b/resources/lib/kodidb_functions.py @@ -303,7 +303,11 @@ class KodiDBMethods(object): # Add all new entries that haven't already been added query = 'INSERT INTO %s VALUES (?, ?, ?)' % link_table for entry_id in entry_ids: - self.cursor.execute(query, (entry_id, kodi_id, kodi_type)) + try: + self.cursor.execute(query, (entry_id, kodi_id, kodi_type)) + except IntegrityError: + LOG.info('IntegrityError: skipping entry %s for table %s', + entry_id, link_table) # Delete all outdated references in the link table. Also check whether # we need to delete orphaned entries in the master table query = ''' From f9cc0f249d788efc0780f6ad57328d76557f710f Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 13 May 2018 13:34:14 +0200 Subject: [PATCH 11/19] Tweak PKC settings --- .../resource.language.en_gb/strings.po | 10 +- resources/settings.xml | 108 +++++++++--------- 2 files changed, 62 insertions(+), 56 deletions(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index e62c76dc..43d86404 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -487,7 +487,7 @@ msgstr "" # PKC Settings - Advanced msgctxt "#30535" -msgid "[COLOR yellow]Generate a new unique device Id (e.g. when cloning Kodi)[/COLOR]" +msgid "Generate a new unique Plex device Id (e.g. to clone Kodi)" msgstr "" # PKC Settings - Connection @@ -502,7 +502,7 @@ msgstr "" # PKC Settings warning msgctxt "#30538" -msgid "Complete Re-Sync necessary" +msgid "Manual complete reset of Kodi database necessary, see \"Advanced\"" msgstr "" # PKC Settings - Artwork @@ -610,7 +610,7 @@ msgstr "" # PKC Settings - Sync msgctxt "#39003" -msgid "Limit download sync threads (rec. for rpi: 1)" +msgid "Number of simultaneous download threads" msgstr "" # PKC Settings - Plex @@ -675,12 +675,12 @@ msgstr "" # PKC Settings - Advanced msgctxt "#39018" -msgid "[COLOR yellow]Repair local database (force update all content)[/COLOR]" +msgid "Repair the Kodi database (force update all content)" msgstr "" # PKC Settings - Advanced msgctxt "#39019" -msgid "[COLOR red]Partial or full reset of Database and PKC[/COLOR]" +msgid "Reset the Kodi database and optionally reset PlexKodiConnect" msgstr "" # PKC Settings - Artwork diff --git a/resources/settings.xml b/resources/settings.xml index d8e46400..4f92a9f8 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -29,17 +29,16 @@ - + - + + - - @@ -57,26 +56,27 @@ - - - - - - - - - + + + + + + + + + + + + + + - - - - - - + + @@ -94,31 +94,32 @@ - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + @@ -141,24 +142,29 @@ --> - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + From d16296395f69dc351472773c2e43a4526a6fefae Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 13 May 2018 14:20:39 +0200 Subject: [PATCH 12/19] Show caching progress for Plex images in the PKC settings --- .../resource.language.en_gb/strings.po | 16 ++++++-- resources/lib/artwork.py | 39 ++++++++++++++----- resources/settings.xml | 5 ++- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 43d86404..a73605d8 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -43,12 +43,12 @@ msgstr "" # Sync notification displayed if there is still artwork to be cached to Kodi msgctxt "#30006" -msgid "Caching %s images" +msgid "Caching %s Plex images" msgstr "" # Sync notification displayed if syncing of major artwork is done msgctxt "#30007" -msgid "Major image caching done" +msgid "Plex image caching done" msgstr "" # PKC settings artwork: Enable notifications for artwork image sync @@ -61,6 +61,16 @@ msgctxt "#30009" msgid "Enable image caching during Kodi playback (restart Kodi!)" msgstr "" +# PKC settings - Artwork +msgctxt "#30010" +msgid "Approximate caching progress" +msgstr "" + +# PKC settings - Artwork +msgctxt "#30011" +msgid "Plex artwork (posters and backgrounds) left to cache:" +msgstr "" + # Button text msgctxt "#30012" msgid "OK" @@ -407,7 +417,7 @@ msgstr "" # PKC Settings - Artwork msgctxt "#30512" -msgid "Force artwork caching" +msgid "Cache all artwork for a smooth Kodi experience" msgstr "" # PKC Settings - Artwork diff --git a/resources/lib/artwork.py b/resources/lib/artwork.py index 5ab1199c..3362a472 100644 --- a/resources/lib/artwork.py +++ b/resources/lib/artwork.py @@ -69,7 +69,15 @@ class Image_Cache_Thread(Thread): sleep(1000) continue if isinstance(url, ArtworkSyncMessage): - if state.IMAGE_SYNC_NOTIFICATIONS: + if url.major_artwork_counter is not None: + if url.major_artwork_counter == 0: + # Done caching, show this in the PKC settings, too + settings('caching_major_artwork', value=lang(30069)) + LOG.info('Done caching major images!') + else: + settings('caching_major_artwork', + value=str(url.major_artwork_counter)) + if url.message and state.IMAGE_SYNC_NOTIFICATIONS: dialog('notification', heading=lang(29999), message=url.message, @@ -110,9 +118,9 @@ class Image_Cache_Thread(Thread): sleep((2**sleeptime) * 1000) sleeptime += 1 continue - except Exception as e: + except Exception as err: LOG.error('Unknown exception for url %s: %s'. - double_urldecode(url), e) + double_urldecode(url), err) import traceback LOG.error("Traceback:\n%s", traceback.format_exc()) break @@ -159,15 +167,25 @@ class Artwork(): connection.close() if not artworks_to_cache: LOG.info('Caching of major images to Kodi texture cache done') + # Set to "None" + settings('caching_major_artwork', value=lang(30069)) return + length = len(artworks_to_cache) LOG.info('Caching has not been completed - caching %s major images', - len(artworks_to_cache)) - # Caching %s images - self.queue.put(ArtworkSyncMessage(lang(30006) % len(artworks_to_cache))) - for url in artworks_to_cache: + length) + settings('caching_major_artwork', value=str(length)) + # Caching %s Plex images + self.queue.put(ArtworkSyncMessage(message=lang(30006) % length, + major_artwork_counter=length)) + for i, url in enumerate(artworks_to_cache): self.queue.put(url[0]) - # Major image caching done - self.queue.put(ArtworkSyncMessage(lang(30007))) + if (length - i) % 10 == 0: + # Update the PKC settings for artwork caching progress + msg = ArtworkSyncMessage(major_artwork_counter=length - i) + self.queue.put(msg) + # Plex image caching done + self.queue.put(ArtworkSyncMessage(message=lang(30007), + major_artwork_counter=0)) def fullTextureCacheSync(self): """ @@ -325,5 +343,6 @@ class ArtworkSyncMessage(object): """ Put in artwork queue to display the message as a Kodi notification """ - def __init__(self, message): + def __init__(self, message=None, major_artwork_counter=None): self.message = message + self.major_artwork_counter = major_artwork_counter diff --git a/resources/settings.xml b/resources/settings.xml index 4f92a9f8..a5f33022 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -123,12 +123,15 @@ - + + + + - + - - + + +