From a1bda39e9d129cb077836c5e7793833109ad7b64 Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 21 Feb 2020 08:22:09 +0100 Subject: [PATCH 01/23] Correctly detect whether we can use SSL to connect to the PMS --- resources/lib/plex_functions.py | 39 ++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/resources/lib/plex_functions.py b/resources/lib/plex_functions.py index 52e403d7..c9e29491 100644 --- a/resources/lib/plex_functions.py +++ b/resources/lib/plex_functions.py @@ -846,28 +846,31 @@ def _pms_https_enabled(url): Prefers HTTPS over HTTP """ - res = DU().downloadUrl('https://%s/identity' % url, - authenticate=False, - verifySSL=True if v.KODIVERSION >= 18 else False) + # Try HTTPS first try: - res.attrib - except AttributeError: - # Might have SSL deactivated. Try with http - res = DU().downloadUrl('http://%s/identity' % url, - authenticate=False, - verifySSL=True if v.KODIVERSION >= 18 else False) - try: - res.attrib - except AttributeError: - LOG.error("Could not contact PMS %s", url) - return None - else: - # Received a valid XML. Server wants to talk HTTP - return False + DU().downloadUrl('https://%s/identity' % url, + authenticate=False, + reraise=True) + except exceptions.SSLError: + LOG.debug('SSLError trying to connect to https://%s/identity', url) + except Exception as e: + LOG.info('Couldnt check https connection to https://%s/identity: %s', + url, e) else: - # Received a valid XML. Server wants to talk HTTPS return True + # Try HTTP next + try: + DU().downloadUrl('http://%s/identity' % url, + authenticate=False, + reraise=True) + except Exception as e: + LOG.info('Couldnt check http connection to http://%s/identity: %s', + url, e) + return + else: + return False + def GetMachineIdentifier(url): """ From 83598ff3f1232fee331d0b0efc0b555e66f434a5 Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 21 Feb 2020 08:40:41 +0100 Subject: [PATCH 02/23] Fix PKC auto-connecting to a local PMS --- resources/lib/initialsetup.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/resources/lib/initialsetup.py b/resources/lib/initialsetup.py index 809300b6..b8536dec 100644 --- a/resources/lib/initialsetup.py +++ b/resources/lib/initialsetup.py @@ -241,20 +241,18 @@ class InitialSetup(object): """ Checks for server's connectivity. Returns check_connection result """ - # Re-direct via plex if remote - will lead to the correct SSL - # certificate if server['local']: - url = ('%s://%s:%s' - % (server['scheme'], server['ip'], server['port'])) # Deactive SSL verification if the server is local for Kodi 17 verifySSL = True if v.KODIVERSION >= 18 else False else: - url = server['baseURL'] verifySSL = True - chk = PF.check_connection(url, - token=server['token'], - verifySSL=verifySSL) - return chk + if not server['token']: + # Plex GDM: we only get the token from plex.tv after + # Sign-in to plex.tv + server['token'] = utils.settings('plexToken') or None + return PF.check_connection(server['baseURL'], + token=server['token'], + verifySSL=verifySSL) def pick_pms(self, showDialog=False, inform_of_search=False): """ From cad59235466b50682adbb783613339274b1b6a0d Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 21 Feb 2020 09:12:59 +0100 Subject: [PATCH 03/23] Improve logic to connect to local PMS via plex.direct redirect --- resources/lib/plex_functions.py | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/resources/lib/plex_functions.py b/resources/lib/plex_functions.py index c9e29491..045d1a5f 100644 --- a/resources/lib/plex_functions.py +++ b/resources/lib/plex_functions.py @@ -210,24 +210,31 @@ def discover_pms(token=None): if pms['machineIdentifier'] == plex_pms['machineIdentifier']: break else: - # Only found PMS using GDM - add it to the PMS from plex.tv - https = _pms_https_enabled('%s:%s' % (pms['ip'], pms['port'])) - if https is None: - # Error contacting url. Skip and ignore this PMS for now - LOG.error('Could not contact PMS %s but we should have', pms) - continue - elif https is True: - pms['scheme'] = 'https' - else: - pms['scheme'] = 'http' - pms['baseURL'] = '%s://%s:%s' % (pms['scheme'], - pms['ip'], - pms['port']) + # Only found PMS using GDM. Check whether we can use baseURL + # (which is in a different format) or need to connect directly + if not _correct_baseurl(pms, + '%s:%s' % (pms['baseURL'], pms['port'])): + if not _correct_baseurl(pms, + '%s:%s' % (pms['ip'], pms['port'])): + continue plex_pms_list.append(pms) _log_pms(plex_pms_list) return plex_pms_list +def _correct_baseurl(pms, url): + https = _pms_https_enabled(url) + if https is None: + # Error contacting url + return False + elif https is True: + pms['scheme'] = 'https' + else: + pms['scheme'] = 'http' + pms['baseURL'] = '%s://%s' % (pms['scheme'], url) + return True + + def _log_pms(pms_list): log_list = deepcopy(pms_list) for pms in log_list: From ddf4999caae08836a8a93577b875024b3729bdc3 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 23 Feb 2020 14:39:13 +0100 Subject: [PATCH 04/23] Fix PKC not burning in (and thus not showing) subtitles when transcoding --- resources/lib/plex_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lib/plex_functions.py b/resources/lib/plex_functions.py index 52e403d7..8b2a2ca6 100644 --- a/resources/lib/plex_functions.py +++ b/resources/lib/plex_functions.py @@ -1078,7 +1078,7 @@ def transcoding_arguments(path, media, part, playmethod, args=None): # none, embedded, sidecar # Essentially indicating what you want to do with subtitles and state # you aren’t want it to burn them into the video (requires transcoding) - 'subtitles': 'none', + # 'subtitles': 'none', # 'subtitleSize': utils.settings('subtitleSize') 'copyts': 1 } From f2fa3bfc41689f1fd2df50f45b21852230bc5e9f Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 23 Feb 2020 14:43:03 +0100 Subject: [PATCH 05/23] Ensure that our only video transcoding target is h264 --- resources/lib/variables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lib/variables.py b/resources/lib/variables.py index 3cba3bc2..53bf8579 100644 --- a/resources/lib/variables.py +++ b/resources/lib/variables.py @@ -482,7 +482,7 @@ STREAMING_HEADERS = { 'context=streaming&' 'protocol=hls&' 'container=mpegts&' - 'videoCodec=h264,hevc,mpeg4,mpeg2video&' + 'videoCodec=h264&' 'audioCodec=aac,flac,vorbis,opus,ac3,eac3,mp3,mp2,pcm&' 'subtitleCodec=ass,pgs,vobsub&' 'replace=true)' From 690d0ce459737c38bce960202ae280319f562d93 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 23 Feb 2020 14:45:10 +0100 Subject: [PATCH 06/23] Don't transcode subtitles to .ass when burning in --- resources/lib/variables.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/lib/variables.py b/resources/lib/variables.py index 3cba3bc2..984f3834 100644 --- a/resources/lib/variables.py +++ b/resources/lib/variables.py @@ -484,8 +484,13 @@ STREAMING_HEADERS = { 'container=mpegts&' 'videoCodec=h264,hevc,mpeg4,mpeg2video&' 'audioCodec=aac,flac,vorbis,opus,ac3,eac3,mp3,mp2,pcm&' - 'subtitleCodec=ass,pgs,vobsub&' 'replace=true)' + # '+add-transcode-target(' + # 'type=subtitleProfile&' + # 'context=all&' + # 'container=ass&' + # 'codec=ass&' + # 'replace=true)' '+add-direct-play-profile(' 'type=videoProfile&' 'container=*&' From 1021c47b0473a96821dd8fb9c4e2b20a90c7a47b Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 23 Feb 2020 15:31:37 +0100 Subject: [PATCH 07/23] When transcoding, only let user choose to burn-in subtitles that can't be displayed otherwise by Kodi --- .../resource.language.en_gb/strings.po | 9 +-- resources/lib/playback_decision.py | 81 +++++++++---------- resources/settings.xml | 1 - 3 files changed, 38 insertions(+), 53 deletions(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 8e4966d9..01c63f6f 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -1060,11 +1060,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "" - # Pop-up during initial sync msgctxt "#39076" msgid "If you use several Plex libraries of one kind, e.g. \"Kids Movies\" and \"Parents Movies\", be sure to check the Wiki: https://goo.gl/JFtQV9" @@ -1369,9 +1364,9 @@ msgid "Use at your own risk" msgstr "" -# If user gets prompted to choose between several subtitles. Leave the number one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" +msgid "Don't burn-in any subtitle" msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and language is unknown diff --git a/resources/lib/playback_decision.py b/resources/lib/playback_decision.py index 522caf77..4f0a855f 100644 --- a/resources/lib/playback_decision.py +++ b/resources/lib/playback_decision.py @@ -337,8 +337,8 @@ def audio_subtitle_prefs(api, listitem): audio_streams_list = [] audio_streams = [] subtitle_streams_list = [] - # No subtitles as an option - subtitle_streams = [utils.lang(39706)] + # "Don't burn-in any subtitle" + subtitle_streams = ['1 %s' % utils.lang(39706)] downloadable_streams = [] download_subs = [] # selectAudioIndex = "" @@ -346,7 +346,6 @@ def audio_subtitle_prefs(api, listitem): audio_numb = 0 # Remember 'no subtitles' sub_num = 1 - default_sub = None for stream in mediastreams: # Since Plex returns all possible tracks together, have to sort @@ -373,21 +372,11 @@ def audio_subtitle_prefs(api, listitem): # Subtitles elif typus == "3": - try: - track = '{} {}'.format(sub_num, stream.attrib['displayTitle']) - except KeyError: - track = '{} {} ({})'.format(sub_num + 1, - utils.lang(39707), # unknown - stream.get('codec')) - default = stream.get('default') - forced = stream.get('forced') downloadable = stream.get('key') - - if default: - track = "%s - %s" % (track, utils.lang(39708)) # Default - if forced: - track = "%s - %s" % (track, utils.lang(39709)) # Forced if downloadable: + # Download the subtitle to Kodi - the user will need to + # manually select the subtitle on the Kodi side + # Hence do NOT show dialog for this sub path = api.download_external_subtitles( '{{server}}{}'.format(stream.get('key')), stream.get('displayTitle'), @@ -396,15 +385,24 @@ def audio_subtitle_prefs(api, listitem): downloadable_streams.append(index) download_subs.append(path.encode('utf-8')) else: + # Burn in the subtitle, if user chooses to do so + default = stream.get('default') + forced = stream.get('forced') + try: + track = '{} {}'.format(sub_num + 1, + stream.attrib['displayTitle']) + except KeyError: + track = '{} {} ({})'.format(sub_num + 1, + utils.lang(39707), # unknown + stream.get('codec')) + if default: + track = "%s - %s" % (track, utils.lang(39708)) # Default + if forced: + track = "%s - %s" % (track, utils.lang(39709)) # Forced track = "%s (%s)" % (track, utils.lang(39710)) # burn-in - if stream.get('selected') == '1' and downloadable: - # Only show subs without asking user if they can be - # turned off - default_sub = index - - subtitle_streams_list.append(index) - subtitle_streams.append(track.encode('utf-8')) - sub_num += 1 + subtitle_streams_list.append(index) + subtitle_streams.append(track.encode('utf-8')) + sub_num += 1 if audio_numb > 1: resp = utils.dialog('select', utils.lang(33013), audio_streams) @@ -418,30 +416,23 @@ def audio_subtitle_prefs(api, listitem): action_type='PUT', parameters=args) - if sub_num == 1: - # No subtitles - return - - select_subs_index = None - if (utils.settings('pickPlexSubtitles') == 'true' and - default_sub is not None): - LOG.info('Using default Plex subtitle: %s', default_sub) - select_subs_index = default_sub - else: - resp = utils.dialog('select', utils.lang(33014), subtitle_streams) - if resp > 0: - select_subs_index = subtitle_streams_list[resp - 1] - else: - # User selected no subtitles or backed out of dialog - select_subs_index = '' - - LOG.debug('Adding external subtitles: %s', download_subs) + LOG.debug('Adding downloadable subtitles: %s', download_subs) # Enable Kodi to switch autonomously to downloadable subtitles if download_subs: listitem.setSubtitles(download_subs) - # Don't additionally burn in subtitles - if select_subs_index in downloadable_streams: - select_subs_index = '' + if sub_num == 1: + LOG.debug('No subtitles to burn-in') + return + + resp = utils.dialog('select', utils.lang(33014), subtitle_streams) + if resp < 1: + # User did not select a subtitle or backed out of the dialog + LOG.debug('User chose to not burn-in any subtitles') + return + select_subs_index = subtitle_streams_list[resp - 1] + LOG.debug('User chose to burn-in subtitle %s: %s', + select_subs_index, + subtitle_streams[resp].decode('utf-8')) # Now prep the PMS for our choice args = { 'subtitleStreamID': select_subs_index, diff --git a/resources/settings.xml b/resources/settings.xml index 5a98c653..61ff23e6 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -107,7 +107,6 @@ - From 9abca33a537314290002b7bc0e273b13a659605c Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 23 Feb 2020 15:50:17 +0100 Subject: [PATCH 08/23] Update translations --- .../resource.language.cs_CZ/strings.po | 12 ++--- .../resource.language.da_DK/strings.po | 12 ++--- .../resource.language.de_DE/strings.po | 16 +++---- .../resource.language.es_AR/strings.po | 12 ++--- .../resource.language.es_ES/strings.po | 12 ++--- .../resource.language.es_MX/strings.po | 12 ++--- .../resource.language.fr_CA/strings.po | 12 ++--- .../resource.language.fr_FR/strings.po | 12 ++--- .../resource.language.hu_HU/strings.po | 27 ++++++------ .../resource.language.it_IT/strings.po | 12 ++--- .../resource.language.lt_LT/strings.po | 12 ++--- .../resource.language.lv_LV/strings.po | 44 ++++++++----------- .../resource.language.nl_NL/strings.po | 12 ++--- .../resource.language.no_NO/strings.po | 12 ++--- .../resource.language.pt_BR/strings.po | 12 ++--- .../resource.language.pt_PT/strings.po | 12 ++--- .../resource.language.ru_RU/strings.po | 14 ++---- .../resource.language.sv_SE/strings.po | 12 ++--- .../resource.language.uk_UA/strings.po | 18 +++----- .../resource.language.zh_CN/strings.po | 10 +---- .../resource.language.zh_TW/strings.po | 10 +---- 21 files changed, 94 insertions(+), 213 deletions(-) diff --git a/resources/language/resource.language.cs_CZ/strings.po b/resources/language/resource.language.cs_CZ/strings.po index 003c0c26..1ffb6491 100644 --- a/resources/language/resource.language.cs_CZ/strings.po +++ b/resources/language/resource.language.cs_CZ/strings.po @@ -1141,11 +1141,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Seriály" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Vždy použít výchozí titulky Plexu, pokud je to možné" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1514,11 +1509,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Používejte na vlastní nebezpečí" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Žádné titulky" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.da_DK/strings.po b/resources/language/resource.language.da_DK/strings.po index 4298115f..c8dd4890 100644 --- a/resources/language/resource.language.da_DK/strings.po +++ b/resources/language/resource.language.da_DK/strings.po @@ -1146,11 +1146,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "TV-udsendelser" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Brug altid standard Plex undertekst hvis muligt" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1524,11 +1519,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Brug på eget ansvar" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1No undertekster" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.de_DE/strings.po b/resources/language/resource.language.de_DE/strings.po index dd03b392..4a859d1a 100644 --- a/resources/language/resource.language.de_DE/strings.po +++ b/resources/language/resource.language.de_DE/strings.po @@ -1,6 +1,6 @@ # XBMC Media Center language file # Translators: -# Croneter None , 2019 +# Croneter None , 2020 # msgid "" msgstr "" @@ -8,7 +8,7 @@ msgstr "" "Report-Msgid-Bugs-To: croneter@gmail.com\n" "POT-Creation-Date: 2017-04-15 13:13+0000\n" "PO-Revision-Date: 2017-04-30 08:30+0000\n" -"Last-Translator: Croneter None , 2019\n" +"Last-Translator: Croneter None , 2020\n" "Language-Team: German (Germany) (https://www.transifex.com/croneter/teams/73837/de_DE/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -1159,11 +1159,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Serien" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Falls möglich, Plex Standard-Untertitel anzeigen" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1544,11 +1539,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Benutzung auf eigene Gefahr" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Untertitel deaktivieren" +msgid "Don't burn-in any subtitle" +msgstr "Keinen Untertitel einbrennen" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.es_AR/strings.po b/resources/language/resource.language.es_AR/strings.po index 4fbeccef..500c8b78 100644 --- a/resources/language/resource.language.es_AR/strings.po +++ b/resources/language/resource.language.es_AR/strings.po @@ -1159,11 +1159,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Series" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Siempre use subtítulos de Plex por defecto si es posible" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1539,11 +1534,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Usar a su propio riesgo" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Sin subtitulos" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.es_ES/strings.po b/resources/language/resource.language.es_ES/strings.po index c56cc00f..aa332347 100644 --- a/resources/language/resource.language.es_ES/strings.po +++ b/resources/language/resource.language.es_ES/strings.po @@ -1160,11 +1160,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Series" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Siempre use subtítulos de Plex por defecto si es posible" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1540,11 +1535,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Usar a su propio riesgo" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Sin subtitulos" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.es_MX/strings.po b/resources/language/resource.language.es_MX/strings.po index 70f55dc3..f7ec0daa 100644 --- a/resources/language/resource.language.es_MX/strings.po +++ b/resources/language/resource.language.es_MX/strings.po @@ -1159,11 +1159,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Series" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Siempre use subtítulos de Plex por defecto si es posible" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1539,11 +1534,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Usar a su propio riesgo" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Sin subtitulos" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.fr_CA/strings.po b/resources/language/resource.language.fr_CA/strings.po index 9fa32a7f..2454c07e 100644 --- a/resources/language/resource.language.fr_CA/strings.po +++ b/resources/language/resource.language.fr_CA/strings.po @@ -1168,11 +1168,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Séries TV" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Utilisez toujours le sous-titre Plex par défaut si possible" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1550,11 +1545,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "A utiliser à vos propres risques" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 pas de sous titre" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.fr_FR/strings.po b/resources/language/resource.language.fr_FR/strings.po index 251d1e46..c1774797 100644 --- a/resources/language/resource.language.fr_FR/strings.po +++ b/resources/language/resource.language.fr_FR/strings.po @@ -1172,11 +1172,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Séries TV" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Utilisez toujours le sous-titre Plex par défaut si possible" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1554,11 +1549,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "A utiliser à vos propres risques" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 pas de sous titre" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.hu_HU/strings.po b/resources/language/resource.language.hu_HU/strings.po index c0400156..f17c0d44 100644 --- a/resources/language/resource.language.hu_HU/strings.po +++ b/resources/language/resource.language.hu_HU/strings.po @@ -1,7 +1,7 @@ # XBMC Media Center language file # Translators: # Croneter None , 2019 -# Savage93 , 2019 +# Savage93 , 2020 # msgid "" msgstr "" @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: croneter@gmail.com\n" "POT-Creation-Date: 2017-04-15 13:13+0000\n" "PO-Revision-Date: 2017-04-30 08:30+0000\n" -"Last-Translator: Savage93 , 2019\n" +"Last-Translator: Savage93 , 2020\n" "Language-Team: Hungarian (Hungary) (https://www.transifex.com/croneter/teams/73837/hu_HU/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -264,6 +264,8 @@ msgstr "Videóminőség, ha transzkódolás szükséges" msgctxt "#30161" msgid "Auto-adjust transcoding quality (deactivate for Chromecast)" msgstr "" +"Transzkódolás minőségének automatikus beállítása (kapcsolja ki Chromecasttal" +" való használatkor)" msgctxt "#30165" msgid "Direct Play" @@ -713,13 +715,13 @@ msgstr "A szerver elérhető" # Plex notification when we need to transcode msgctxt "#33004" msgid "PMS enforced transcoding" -msgstr "" +msgstr "PMS kényszerített transzkódolás" # Plex notification when we need to use direct streaming (instead of # transcoding) msgctxt "#33005" msgid "PMS enforced direct streaming" -msgstr "" +msgstr "PMS kényszerített közvetlen streamelés" # Error notification msgctxt "#33009" @@ -1074,6 +1076,8 @@ msgctxt "#39056" msgid "" "Used by sync and when attempting Direct Paths. Restart Kodi on changes!" msgstr "" +"Szinkronizáció és közvetlen elérési utak használata esetén szükséges. " +"Módosítás esetén indítsa újra a Kodi-t!" # PKC Settings, category name msgctxt "#39057" @@ -1157,12 +1161,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "TV sorozatok" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "" -"Mindig használja az alapértelmezett Plex feliratot amennyiben lehetséges" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1292,6 +1290,8 @@ msgstr "Adja meg a Plex médiaszerver IP-címét vagy URL-jét, például:" msgctxt "#39217" msgid "Use HTTPS (SSL) connections? Answer should probably be yes." msgstr "" +"Kíván HTTPS (SSL) kapcsolatokat használni? Ha nem biztos benne válassza az " +"igent." msgctxt "#39218" msgid "Error contacting PMS" @@ -1540,11 +1540,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Csak saját felelősségre használja" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Feliratok kikapcsolása" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.it_IT/strings.po b/resources/language/resource.language.it_IT/strings.po index ef44ba78..f4878be7 100644 --- a/resources/language/resource.language.it_IT/strings.po +++ b/resources/language/resource.language.it_IT/strings.po @@ -1162,11 +1162,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Serie TV" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Usa sempre i sottotitoli predefiniti di Plex se possibile" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1548,11 +1543,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Usa a tuo rischio e pericolo" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 No sottotitoli" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.lt_LT/strings.po b/resources/language/resource.language.lt_LT/strings.po index 62064ce0..35921623 100644 --- a/resources/language/resource.language.lt_LT/strings.po +++ b/resources/language/resource.language.lt_LT/strings.po @@ -1155,11 +1155,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "TV Laidos" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Jei įmanoma, visada naudokite numatytuosius „Plex“ subtitrus" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1536,11 +1531,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Naudokite savo pačių rizika" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Nėra subtitrų" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.lv_LV/strings.po b/resources/language/resource.language.lv_LV/strings.po index 90c6fa47..19084f28 100644 --- a/resources/language/resource.language.lv_LV/strings.po +++ b/resources/language/resource.language.lv_LV/strings.po @@ -591,7 +591,7 @@ msgstr "" # PKC Settings - Sync Options msgctxt "#30524" msgid "Select Plex libraries to sync" -msgstr "" +msgstr "Izvēlies kuras Plex bibliotēkas sinhronizēt" # PKC Settings - Playback msgctxt "#30527" @@ -702,13 +702,13 @@ msgstr "Serveris ir tiešsaistē" # Plex notification when we need to transcode msgctxt "#33004" msgid "PMS enforced transcoding" -msgstr "" +msgstr "PMS uzspiestā transkodēšana" # Plex notification when we need to use direct streaming (instead of # transcoding) msgctxt "#33005" msgid "PMS enforced direct streaming" -msgstr "" +msgstr "PMS uzspiestā tiešā straumēšana" # Error notification msgctxt "#33009" @@ -717,11 +717,11 @@ msgstr "Nederīgs lietotājvārds vai parole" msgctxt "#33010" msgid "User is unauthorized for server {0}" -msgstr "" +msgstr "Lietotājs ir neautorizēts serverī {0}" msgctxt "#33011" msgid "Plex.tv did not provide us a valid list of Plex users, sorry." -msgstr "" +msgstr "Plex.tv mums nedeva derīgu Plex lietotāju sarakstu, piedod." # Dialog before playback msgctxt "#33013" @@ -858,7 +858,7 @@ msgstr "Atiestatīt Kodi datubāzi un iespējams atiestatīt PlexKodiConnect" # PKC Settings - Artwork msgctxt "#39020" msgid "Cache all images to Kodi texture cache now" -msgstr "" +msgstr "Iekešot visus attēlus Kodi tekstūru kešatmiņā tagad" # Appended to a listed PMS if it is in the same LAN network as PKC msgctxt "#39022" @@ -1022,7 +1022,7 @@ msgstr "Nekas nestrādā? Pamēģini pilnu atiestatīšanu!" # PKC Settings - Connection msgctxt "#39050" msgid "Choose Plex Server from a list" -msgstr "" +msgstr "Izvēlies Plex serveri no saraksta" # PKC Settings - Sync msgctxt "#39051" @@ -1137,11 +1137,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Seriāli" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Vienmēr lietot noklusētos Plex titrus, ja iespējams" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1210,7 +1205,7 @@ msgstr "Iestatījumi" msgctxt "#39204" msgid "Perform manual library sync" -msgstr "" +msgstr "Veikt manuālu bibliotēkas sinhronizēšanu" # Error message msgctxt "#39205" @@ -1415,7 +1410,7 @@ msgstr "" msgctxt "#39410" msgid "ERROR in library sync" -msgstr "" +msgstr "KĻŪDA sinhronizējot bibliotēku" msgctxt "#39500" msgid "On Deck" @@ -1423,11 +1418,11 @@ msgstr "Izcelts" msgctxt "#39501" msgid "Collections" -msgstr "" +msgstr "Kolekcijas" msgctxt "#39502" msgid "PKC On Deck (faster)" -msgstr "" +msgstr "PKC On Deck (ātrāk)" msgctxt "#39600" msgid "" @@ -1479,29 +1474,28 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" +msgid "Don't burn-in any subtitle" msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown msgctxt "#39707" msgid "unknown" -msgstr "" +msgstr "nezināms" # If user gets prompted to choose between several subtitles and Plex adds the # "default" flag msgctxt "#39708" msgid "Default" -msgstr "" +msgstr "Noklusējums" # If user gets prompted to choose between several subtitles and Plex adds the # "forced" flag msgctxt "#39709" msgid "Forced" -msgstr "" +msgstr "Uzspiests" # If user gets prompted to choose between several subtitles the subtitle # cannot be downloaded (has no 'key' attribute from the PMS), the subtitle @@ -1521,17 +1515,17 @@ msgstr "" # Shown during sync process msgctxt "#39712" msgid "downloaded" -msgstr "" +msgstr "lejupielādēts" # Shown during sync process msgctxt "#39713" msgid "processed" -msgstr "" +msgstr "apstrādāts" # Shown during sync process msgctxt "#39714" msgid "Sync" -msgstr "" +msgstr "Sinhronizēt" # Shown during sync process msgctxt "#39715" diff --git a/resources/language/resource.language.nl_NL/strings.po b/resources/language/resource.language.nl_NL/strings.po index b49cf710..a04a4de7 100644 --- a/resources/language/resource.language.nl_NL/strings.po +++ b/resources/language/resource.language.nl_NL/strings.po @@ -1149,11 +1149,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "TV series" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Gebruik indien mogelijk altijd standaard Plex ondertitels" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1524,11 +1519,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Gebruik op eigen risico" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Geen ondertiteling" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.no_NO/strings.po b/resources/language/resource.language.no_NO/strings.po index 2c6a94db..63af2f7b 100644 --- a/resources/language/resource.language.no_NO/strings.po +++ b/resources/language/resource.language.no_NO/strings.po @@ -1142,11 +1142,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "TV-show" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Bruk alltid standard Plex undertekst når mulig" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1517,11 +1512,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Bruk på eget ansvar" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Ingen undertekst" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.pt_BR/strings.po b/resources/language/resource.language.pt_BR/strings.po index 6e360a35..ad348c63 100644 --- a/resources/language/resource.language.pt_BR/strings.po +++ b/resources/language/resource.language.pt_BR/strings.po @@ -1138,11 +1138,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Programas de TV" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Utilize sempre as legendas Plex se possível" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1512,11 +1507,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Use por risco de conta própria" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Sem legendas" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.pt_PT/strings.po b/resources/language/resource.language.pt_PT/strings.po index f2ab40e6..962c4892 100644 --- a/resources/language/resource.language.pt_PT/strings.po +++ b/resources/language/resource.language.pt_PT/strings.po @@ -1141,11 +1141,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Programas de TV" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Utilize sempre as legendas Plex se possível" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1515,11 +1510,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Use por risco de conta própria" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Sem legendas" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.ru_RU/strings.po b/resources/language/resource.language.ru_RU/strings.po index fa903e96..b931642b 100644 --- a/resources/language/resource.language.ru_RU/strings.po +++ b/resources/language/resource.language.ru_RU/strings.po @@ -1,7 +1,7 @@ # XBMC Media Center language file # Translators: # Croneter None , 2017 -# Алексей Коробцов , 2017 +# Alexey Korobcov , 2017 # Павел Хоменко, 2017 # Alex Freit , 2019 # Vladimir Supranenok , 2019 @@ -1154,11 +1154,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Сериалы" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Использовать субтитры по умолчанию из Plex, если доступны" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1530,11 +1525,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Используйте на свой страх и риск" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Без субтитров" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.sv_SE/strings.po b/resources/language/resource.language.sv_SE/strings.po index a8dbed0a..7a1dedc0 100644 --- a/resources/language/resource.language.sv_SE/strings.po +++ b/resources/language/resource.language.sv_SE/strings.po @@ -1143,11 +1143,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "TV-Serier" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Använd alltid standard-undertext från Plex om möjligt" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1518,11 +1513,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Använd på egen risk" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Inga undertexter" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.uk_UA/strings.po b/resources/language/resource.language.uk_UA/strings.po index e9250001..908db1dd 100644 --- a/resources/language/resource.language.uk_UA/strings.po +++ b/resources/language/resource.language.uk_UA/strings.po @@ -1,6 +1,6 @@ # XBMC Media Center language file # Translators: -# Vlad Anisimov , 2019 +# Vlad Anisimov , 2020 # msgid "" msgstr "" @@ -8,7 +8,7 @@ msgstr "" "Report-Msgid-Bugs-To: croneter@gmail.com\n" "POT-Creation-Date: 2017-04-15 13:13+0000\n" "PO-Revision-Date: 2017-04-30 08:30+0000\n" -"Last-Translator: Vlad Anisimov , 2019\n" +"Last-Translator: Vlad Anisimov , 2020\n" "Language-Team: Ukrainian (Ukraine) (https://www.transifex.com/croneter/teams/73837/uk_UA/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -262,6 +262,7 @@ msgstr "Якість відео якщо перекодування потріб msgctxt "#30161" msgid "Auto-adjust transcoding quality (deactivate for Chromecast)" msgstr "" +"Автоматичне налаштування якості перекодування (деактивуйте для Chromecast)" msgctxt "#30165" msgid "Direct Play" @@ -1150,11 +1151,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "Серіали" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "Завжди використовувати субтитри Plex за замовчуванням якщо можливо" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1282,6 +1278,7 @@ msgstr "Введіть IP адресу або URL вашого серверу Pl msgctxt "#39217" msgid "Use HTTPS (SSL) connections? Answer should probably be yes." msgstr "" +"Використовувати з'єднання HTTPS (SSL)? Відповідь, мабуть, має бути так." msgctxt "#39218" msgid "Error contacting PMS" @@ -1528,11 +1525,10 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "Використовуйте на свій ризик" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" -msgstr "1 Немає субтитрів" +msgid "Don't burn-in any subtitle" +msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and # language is unknown diff --git a/resources/language/resource.language.zh_CN/strings.po b/resources/language/resource.language.zh_CN/strings.po index 88cd7e20..79e38ae1 100644 --- a/resources/language/resource.language.zh_CN/strings.po +++ b/resources/language/resource.language.zh_CN/strings.po @@ -1107,11 +1107,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "电视节目" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "如可能始终使用默认Plex字幕" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1449,10 +1444,9 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" +msgid "Don't burn-in any subtitle" msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and diff --git a/resources/language/resource.language.zh_TW/strings.po b/resources/language/resource.language.zh_TW/strings.po index 731aeea3..3da4691a 100644 --- a/resources/language/resource.language.zh_TW/strings.po +++ b/resources/language/resource.language.zh_TW/strings.po @@ -1103,11 +1103,6 @@ msgctxt "#39074" msgid "TV Shows" msgstr "電視節目" -# PKC Settings - Playback -msgctxt "#39075" -msgid "Always use default Plex subtitle if possible" -msgstr "如果可能的話,使用預設 Plex 字幕" - # Pop-up during initial sync msgctxt "#39076" msgid "" @@ -1445,10 +1440,9 @@ msgctxt "#39705" msgid "Use at your own risk" msgstr "" -# If user gets prompted to choose between several subtitles. Leave the number -# one at the beginning of the string! +# If user gets prompted to choose between several subtitles to burn in msgctxt "#39706" -msgid "1 No subtitles" +msgid "Don't burn-in any subtitle" msgstr "" # If user gets prompted to choose between several audio/subtitle tracks and From 4f4b89ca77078df70cdc44517c0030511c5982d9 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 23 Feb 2020 15:54:11 +0100 Subject: [PATCH 09/23] Beta version bump 2.11.0 --- 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 e02c1298..eb79447f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![stable version](https://img.shields.io/badge/stable_version-2.10.12-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.10.12-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.11.0-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 4e2944c4..d45444c4 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -83,7 +83,14 @@ Natūralioji „Plex“ integracija į „Kodi“ Prijunkite „Kodi“ prie „Plex Medija Serverio“. Šiame papildinyje daroma prielaida, kad valdote visus savo vaizdo įrašus naudodami „Plex“ (ir nė vieno su „Kodi“). Galite prarasti jau saugomus „Kodi“ vaizdo įrašų ir muzikos duomenų bazių duomenis (kadangi šis papildinys juos tiesiogiai pakeičia). Naudokite savo pačių rizika! Naudokite savo pačių rizika - version 2.10.12: + version 2.11.0 (beta only): +- Fix PKC not burning in (and thus not showing) subtitles when transcoding +- When transcoding, only let user choose to burn-in subtitles that can't be displayed otherwise by Kodi +- Improve PKC automatically connecting to local PMS +- Ensure that our only video transcoding target is h264 +- Fix adjusted subtitle size not working when burning in subtitles + +version 2.10.12: - versions 2.10.5-11 for everyone version 2.10.11 (beta only): diff --git a/changelog.txt b/changelog.txt index 132f35a4..b5ebc8e4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +version 2.11.0 (beta only): +- Fix PKC not burning in (and thus not showing) subtitles when transcoding +- When transcoding, only let user choose to burn-in subtitles that can't be displayed otherwise by Kodi +- Improve PKC automatically connecting to local PMS +- Ensure that our only video transcoding target is h264 +- Fix adjusted subtitle size not working when burning in subtitles + version 2.10.12: - versions 2.10.5-11 for everyone From 98f983a830b5d5e4b232c9d6962c993d309aea10 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 23 Feb 2020 14:40:44 +0100 Subject: [PATCH 10/23] Fix adjusted subtitle size not working when burning in subtitles --- resources/lib/plex_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lib/plex_functions.py b/resources/lib/plex_functions.py index 75c8a032..43dd5885 100644 --- a/resources/lib/plex_functions.py +++ b/resources/lib/plex_functions.py @@ -1089,7 +1089,7 @@ def transcoding_arguments(path, media, part, playmethod, args=None): # Essentially indicating what you want to do with subtitles and state # you aren’t want it to burn them into the video (requires transcoding) # 'subtitles': 'none', - # 'subtitleSize': utils.settings('subtitleSize') + 'subtitleSize': utils.settings('subtitleSize'), 'copyts': 1 } if args: From 41aef50463a739ebaeabd8da1ac47e0eece45097 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 23 Feb 2020 17:19:36 +0100 Subject: [PATCH 11/23] Fix regression: burn-in subtitles picking up the last user setting instead of the current one --- addon.xml | 1 + changelog.txt | 1 + resources/lib/playback.py | 8 ++++++++ resources/lib/playback_decision.py | 27 +++++++++++++-------------- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/addon.xml b/addon.xml index d45444c4..dec5b602 100644 --- a/addon.xml +++ b/addon.xml @@ -89,6 +89,7 @@ - Improve PKC automatically connecting to local PMS - Ensure that our only video transcoding target is h264 - Fix adjusted subtitle size not working when burning in subtitles +- Fix regression: burn-in subtitles picking up the last user setting instead of the current one version 2.10.12: - versions 2.10.5-11 for everyone diff --git a/changelog.txt b/changelog.txt index b5ebc8e4..034fe82c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ version 2.11.0 (beta only): - Improve PKC automatically connecting to local PMS - Ensure that our only video transcoding target is h264 - Fix adjusted subtitle size not working when burning in subtitles +- Fix regression: burn-in subtitles picking up the last user setting instead of the current one version 2.10.12: - versions 2.10.5-11 for everyone diff --git a/resources/lib/playback.py b/resources/lib/playback.py index de5220d0..bb46b21d 100644 --- a/resources/lib/playback.py +++ b/resources/lib/playback.py @@ -451,6 +451,11 @@ def _conclude_playback(playqueue, pos): LOG.debug('Concluding playback for playqueue position %s', pos) item = playqueue.items[pos] api = API(item.xml) + if api.mediastream_number() is None: + # E.g. user could choose between several media streams and cancelled + LOG.debug('Did not get a mediastream_number') + _ensure_resolve() + return api.part = item.part or 0 listitem = api.listitem(listitem=transfer.PKCListItem, resume=False) set_playurl(api, item) @@ -464,6 +469,9 @@ def _conclude_playback(playqueue, pos): elif item.playmethod in (v.PLAYBACK_METHOD_DIRECT_STREAM, v.PLAYBACK_METHOD_TRANSCODE): audio_subtitle_prefs(api, listitem) + # Need to hit the PMS api again in order to get the selected + # burn-in subtitles set-up correctly + set_playurl(api, item) transfer.send(listitem) LOG.debug('Done concluding playback') diff --git a/resources/lib/playback_decision.py b/resources/lib/playback_decision.py index 4f0a855f..4035ad6f 100644 --- a/resources/lib/playback_decision.py +++ b/resources/lib/playback_decision.py @@ -19,9 +19,6 @@ CONVERSION_OK = 1001 # PMS can either direct stream or transcode def set_playurl(api, item): - if api.mediastream_number() is None: - # E.g. user could choose between several media streams and cancelled - return item.playmethod = int(utils.settings('playType')) LOG.info('User chose playback method %s in PKC settings', v.EXPLICIT_PLAYBACK_METHOD[item.playmethod]) @@ -420,19 +417,21 @@ def audio_subtitle_prefs(api, listitem): # Enable Kodi to switch autonomously to downloadable subtitles if download_subs: listitem.setSubtitles(download_subs) + select_subs_index = '' if sub_num == 1: + # Note: we DO need to tell the PMS that we DONT want any sub + # Otherwise, the PMS might pick-up the last one LOG.debug('No subtitles to burn-in') - return - - resp = utils.dialog('select', utils.lang(33014), subtitle_streams) - if resp < 1: - # User did not select a subtitle or backed out of the dialog - LOG.debug('User chose to not burn-in any subtitles') - return - select_subs_index = subtitle_streams_list[resp - 1] - LOG.debug('User chose to burn-in subtitle %s: %s', - select_subs_index, - subtitle_streams[resp].decode('utf-8')) + else: + resp = utils.dialog('select', utils.lang(33014), subtitle_streams) + if resp < 1: + # User did not select a subtitle or backed out of the dialog + LOG.debug('User chose to not burn-in any subtitles') + else: + LOG.debug('User chose to burn-in subtitle %s: %s', + select_subs_index, + subtitle_streams[resp].decode('utf-8')) + select_subs_index = subtitle_streams_list[resp - 1] # Now prep the PMS for our choice args = { 'subtitleStreamID': select_subs_index, From 8bc9ff974f9972d46b522d1ed7e3fb5865ab45a7 Mon Sep 17 00:00:00 2001 From: croneter Date: Tue, 25 Feb 2020 18:16:53 +0100 Subject: [PATCH 12/23] Beta version bump 2.11.1 --- README.md | 2 +- addon.xml | 7 +++++-- changelog.txt | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eb79447f..11797aa7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![stable version](https://img.shields.io/badge/stable_version-2.10.12-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.11.0-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.11.1-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 dec5b602..dedc073e 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -83,7 +83,10 @@ Natūralioji „Plex“ integracija į „Kodi“ Prijunkite „Kodi“ prie „Plex Medija Serverio“. Šiame papildinyje daroma prielaida, kad valdote visus savo vaizdo įrašus naudodami „Plex“ (ir nė vieno su „Kodi“). Galite prarasti jau saugomus „Kodi“ vaizdo įrašų ir muzikos duomenų bazių duomenis (kadangi šis papildinys juos tiesiogiai pakeičia). Naudokite savo pačių rizika! Naudokite savo pačių rizika - version 2.11.0 (beta only): + version 2.11.1 (beta only): +- Rewire the set-up of audio and subtitle streams, esp. before starting a transcoding session. Fixes playback not starting at all + +version 2.11.0 (beta only): - Fix PKC not burning in (and thus not showing) subtitles when transcoding - When transcoding, only let user choose to burn-in subtitles that can't be displayed otherwise by Kodi - Improve PKC automatically connecting to local PMS diff --git a/changelog.txt b/changelog.txt index 034fe82c..956a2a84 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +version 2.11.1 (beta only): +- Rewire the set-up of audio and subtitle streams, esp. before starting a transcoding session. Fixes playback not starting at all + version 2.11.0 (beta only): - Fix PKC not burning in (and thus not showing) subtitles when transcoding - When transcoding, only let user choose to burn-in subtitles that can't be displayed otherwise by Kodi From cc44c72cd62c722687f0495a147c0fc9c538248e Mon Sep 17 00:00:00 2001 From: croneter Date: Tue, 25 Feb 2020 12:04:00 +0100 Subject: [PATCH 13/23] Increase logging --- resources/lib/downloadutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lib/downloadutils.py b/resources/lib/downloadutils.py index 21384bf2..678876c4 100644 --- a/resources/lib/downloadutils.py +++ b/resources/lib/downloadutils.py @@ -291,8 +291,8 @@ class DownloadUtils(): return else: r.encoding = 'utf-8' - LOG.warn('Unknown answer from PMS %s with status code %s. ', - url, r.status_code) + LOG.warn('Unknown answer from PMS %s with status code %s: %s', + url, r.status_code, r.text) return True finally: From f524674b683958e04d2a00e7f6c4a0d8b21e2185 Mon Sep 17 00:00:00 2001 From: croneter Date: Tue, 25 Feb 2020 17:21:15 +0100 Subject: [PATCH 14/23] Increase logging --- resources/lib/playback_decision.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/lib/playback_decision.py b/resources/lib/playback_decision.py index 4035ad6f..50b822cf 100644 --- a/resources/lib/playback_decision.py +++ b/resources/lib/playback_decision.py @@ -34,9 +34,12 @@ def set_playurl(api, item): LOG.info('Lets ask the PMS next') try: _pms_playback_decision(api, item) - except (exceptions.RequestException, AttributeError, IndexError, SystemExit) as err: + except (exceptions.RequestException, + AttributeError, + IndexError, + SystemExit): LOG.warn('Could not find suitable settings for playback, aborting') - LOG.warn('Error received: %s', err) + utils.ERROR(notify=True) item.playmethod = None item.file = None else: From 6a7ca3c4d1947b7e5c468d0619913b5c9509cf54 Mon Sep 17 00:00:00 2001 From: croneter Date: Tue, 25 Feb 2020 17:27:35 +0100 Subject: [PATCH 15/23] Rewire the set-up of audio and subtitle streams, esp. before starting a transcoding session --- resources/lib/playback.py | 33 +++--- resources/lib/playback_decision.py | 156 +++++++++++++++-------------- resources/lib/plex_functions.py | 12 ++- 3 files changed, 102 insertions(+), 99 deletions(-) diff --git a/resources/lib/playback.py b/resources/lib/playback.py index bb46b21d..2b30e741 100644 --- a/resources/lib/playback.py +++ b/resources/lib/playback.py @@ -12,16 +12,10 @@ import xbmc from .plex_api import API from .plex_db import PlexDB -from . import plex_functions as PF -from . import utils from .kodi_db import KodiVideoDB -from . import playlist_func as PL -from . import playqueue as PQ -from . import json_rpc as js -from . import transfer -from .playback_decision import set_playurl, audio_subtitle_prefs -from . import variables as v -from . import app +from . import plex_functions as PF, playlist_func as PL, playqueue as PQ +from . import json_rpc as js, variables as v, utils, transfer +from . import playback_decision, app ############################################################################### LOG = getLogger('PLEX.playback') @@ -457,21 +451,20 @@ def _conclude_playback(playqueue, pos): _ensure_resolve() return api.part = item.part or 0 - listitem = api.listitem(listitem=transfer.PKCListItem, resume=False) - set_playurl(api, item) - if not item.file: - LOG.debug('Did not get a playurl, aborting playback silently') + playback_decision.set_pkc_playmethod(api, item) + if not playback_decision.audio_subtitle_prefs(api, item): + LOG.info('Did not set audio subtitle prefs, aborting silently') _ensure_resolve() return + playback_decision.set_playurl(api, item) + if not item.file: + LOG.info('Did not get a playurl, aborting playback silently') + _ensure_resolve() + return + listitem = api.listitem(listitem=transfer.PKCListItem, resume=False) listitem.setPath(item.file.encode('utf-8')) - if item.playmethod == v.PLAYBACK_METHOD_DIRECT_PLAY: + if item.playmethod != v.PLAYBACK_METHOD_DIRECT_PATH: listitem.setSubtitles(api.cache_external_subs()) - elif item.playmethod in (v.PLAYBACK_METHOD_DIRECT_STREAM, - v.PLAYBACK_METHOD_TRANSCODE): - audio_subtitle_prefs(api, listitem) - # Need to hit the PMS api again in order to get the selected - # burn-in subtitles set-up correctly - set_playurl(api, item) transfer.send(listitem) LOG.debug('Done concluding playback') diff --git a/resources/lib/playback_decision.py b/resources/lib/playback_decision.py index 50b822cf..9fe5ed8e 100644 --- a/resources/lib/playback_decision.py +++ b/resources/lib/playback_decision.py @@ -18,33 +18,36 @@ DIRECT_PLAY_OK = 1000 CONVERSION_OK = 1001 # PMS can either direct stream or transcode -def set_playurl(api, item): +def set_pkc_playmethod(api, item): item.playmethod = int(utils.settings('playType')) LOG.info('User chose playback method %s in PKC settings', v.EXPLICIT_PLAYBACK_METHOD[item.playmethod]) _initial_best_playback_method(api, item) LOG.info('PKC decided on playback method %s', v.EXPLICIT_PLAYBACK_METHOD[item.playmethod]) - if item.playmethod == v.PLAYBACK_METHOD_DIRECT_PATH: - # No need to ask the PMS whether we can play - we circumvent - # the PMS entirely - LOG.info('The playurl for %s is: %s', - v.EXPLICIT_PLAYBACK_METHOD[item.playmethod], item.file) - return - LOG.info('Lets ask the PMS next') + + +def set_playurl(api, item): try: - _pms_playback_decision(api, item) - except (exceptions.RequestException, - AttributeError, - IndexError, - SystemExit): - LOG.warn('Could not find suitable settings for playback, aborting') - utils.ERROR(notify=True) - item.playmethod = None - item.file = None - else: - item.file = api.transcode_video_path(item.playmethod, - quality=item.quality) + if item.playmethod == v.PLAYBACK_METHOD_DIRECT_PATH: + # No need to ask the PMS whether we can play - we circumvent + # the PMS entirely + return + LOG.info('Lets ask the PMS next') + try: + _pms_playback_decision(api, item) + except (exceptions.RequestException, + AttributeError, + IndexError, + SystemExit): + LOG.warn('Could not find suitable settings for playback, aborting') + utils.ERROR(notify=True) + item.playmethod = None + item.file = None + else: + item.file = api.transcode_video_path(item.playmethod, + quality=item.quality) + finally: LOG.info('The playurl for %s is: %s', v.EXPLICIT_PLAYBACK_METHOD[item.playmethod], item.file) @@ -316,12 +319,16 @@ def _getH265(): return H265[utils.settings('transcodeH265')] -def audio_subtitle_prefs(api, listitem): +def audio_subtitle_prefs(api, item): """ - For transcoding only + Sets the stage for transcoding, letting the user potentially choose both + audio and subtitle streams; subtitle streams to burn-into the video file. - Called at the very beginning of play; used to change audio and subtitle - stream by a PUT request to the PMS + Uses a PUT request to the PMS, simulating e.g. the user using Plex Web, + choosing a different stream in the video's metadata and THEN initiating + playback. + + Returns None if user cancelled or we need to abort, True otherwise """ # Set media and part where we're at if (api.mediastream is None and @@ -334,13 +341,21 @@ def audio_subtitle_prefs(api, listitem): api.mediastream, api.part) return part_id = mediastreams.attrib['id'] + if item.playmethod != v.PLAYBACK_METHOD_TRANSCODE: + LOG.debug('Telling PMS we are not burning in any subtitles') + args = { + 'subtitleStreamID': 0, + 'allParts': 1 + } + DU().downloadUrl('{server}/library/parts/%s' % part_id, + action_type='PUT', + parameters=args) + return True audio_streams_list = [] audio_streams = [] subtitle_streams_list = [] # "Don't burn-in any subtitle" subtitle_streams = ['1 %s' % utils.lang(39706)] - downloadable_streams = [] - download_subs = [] # selectAudioIndex = "" select_subs_index = "" audio_numb = 0 @@ -372,66 +387,58 @@ def audio_subtitle_prefs(api, listitem): # Subtitles elif typus == "3": - downloadable = stream.get('key') - if downloadable: - # Download the subtitle to Kodi - the user will need to - # manually select the subtitle on the Kodi side - # Hence do NOT show dialog for this sub - path = api.download_external_subtitles( - '{{server}}{}'.format(stream.get('key')), - stream.get('displayTitle'), - stream.get('codec')) - if path: - downloadable_streams.append(index) - download_subs.append(path.encode('utf-8')) - else: - # Burn in the subtitle, if user chooses to do so - default = stream.get('default') - forced = stream.get('forced') - try: - track = '{} {}'.format(sub_num + 1, - stream.attrib['displayTitle']) - except KeyError: - track = '{} {} ({})'.format(sub_num + 1, - utils.lang(39707), # unknown - stream.get('codec')) - if default: - track = "%s - %s" % (track, utils.lang(39708)) # Default - if forced: - track = "%s - %s" % (track, utils.lang(39709)) # Forced - track = "%s (%s)" % (track, utils.lang(39710)) # burn-in - subtitle_streams_list.append(index) - subtitle_streams.append(track.encode('utf-8')) - sub_num += 1 + if stream.get('key'): + # Subtitle can and will be downloaded - don't let user choose + # this subtitle to burn-in + continue + # Subtitle is available within the video file + # Burn in the subtitle, if user chooses to do so + default = stream.get('default') + forced = stream.get('forced') + try: + track = '{} {}'.format(sub_num + 1, + stream.attrib['displayTitle']) + except KeyError: + track = '{} {} ({})'.format(sub_num + 1, + utils.lang(39707), # unknown + stream.get('codec')) + if default: + track = "%s - %s" % (track, utils.lang(39708)) # Default + if forced: + track = "%s - %s" % (track, utils.lang(39709)) # Forced + track = "%s (%s)" % (track, utils.lang(39710)) # burn-in + subtitle_streams_list.append(index) + subtitle_streams.append(track.encode('utf-8')) + sub_num += 1 if audio_numb > 1: resp = utils.dialog('select', utils.lang(33013), audio_streams) - if resp > -1: - # User selected some audio track - args = { - 'audioStreamID': audio_streams_list[resp], - 'allParts': 1 - } - DU().downloadUrl('{server}/library/parts/%s' % part_id, - action_type='PUT', - parameters=args) + if resp == -1: + LOG.info('User aborted dialog to select audio stream') + return + args = { + 'audioStreamID': audio_streams_list[resp], + 'allParts': 1 + } + DU().downloadUrl('{server}/library/parts/%s' % part_id, + action_type='PUT', + parameters=args) - LOG.debug('Adding downloadable subtitles: %s', download_subs) - # Enable Kodi to switch autonomously to downloadable subtitles - if download_subs: - listitem.setSubtitles(download_subs) select_subs_index = '' if sub_num == 1: # Note: we DO need to tell the PMS that we DONT want any sub # Otherwise, the PMS might pick-up the last one - LOG.debug('No subtitles to burn-in') + LOG.info('No subtitles to burn-in') else: resp = utils.dialog('select', utils.lang(33014), subtitle_streams) - if resp < 1: + if resp == -1: + LOG.info('User aborted dialog to select subtitle stream') + return + elif resp == 0: # User did not select a subtitle or backed out of the dialog - LOG.debug('User chose to not burn-in any subtitles') + LOG.info('User chose to not burn-in any subtitles') else: - LOG.debug('User chose to burn-in subtitle %s: %s', + LOG.info('User chose to burn-in subtitle %s: %s', select_subs_index, subtitle_streams[resp].decode('utf-8')) select_subs_index = subtitle_streams_list[resp - 1] @@ -443,3 +450,4 @@ def audio_subtitle_prefs(api, listitem): DU().downloadUrl('{server}/library/parts/%s' % part_id, action_type='PUT', parameters=args) + return True diff --git a/resources/lib/plex_functions.py b/resources/lib/plex_functions.py index 43dd5885..dac7e2b0 100644 --- a/resources/lib/plex_functions.py +++ b/resources/lib/plex_functions.py @@ -1085,13 +1085,15 @@ def transcoding_arguments(path, media, part, playmethod, args=None): 'protocol': 'hls', # seen in the wild: 'http', 'dash', 'http', 'hls' 'session': v.PKC_MACHINE_IDENTIFIER, # TODO: create new unique id 'fastSeek': 1, - # none, embedded, sidecar - # Essentially indicating what you want to do with subtitles and state - # you aren’t want it to burn them into the video (requires transcoding) - # 'subtitles': 'none', - 'subtitleSize': utils.settings('subtitleSize'), 'copyts': 1 } + if playmethod != v.PLAYBACK_METHOD_TRANSCODE: + # Essentially indicating what you want to do with subtitles and state + # you aren’t want it to burn them into the video (requires transcoding) + # none, embedded, sidecar + args['subtitles'] = 'none' + else: + args['subtitleSize'] = utils.settings('subtitleSize') if args: arguments.update(args) return arguments From 25f972f30fe5bb83a27968adb8e7aed903a2a006 Mon Sep 17 00:00:00 2001 From: croneter Date: Wed, 26 Feb 2020 18:10:15 +0100 Subject: [PATCH 16/23] Refactor direct and add-on paths. Enables use of Plex music playlists synched to Kodi --- resources/lib/context_entry.py | 2 +- resources/lib/itemtypes/movies.py | 39 +++----------- resources/lib/itemtypes/music.py | 30 +---------- resources/lib/itemtypes/tvshows.py | 55 ++++++------------- resources/lib/kodimonitor.py | 2 +- resources/lib/playback.py | 2 +- resources/lib/playlists/kodi_pl.py | 59 +++++++++++++++------ resources/lib/plex_api/file.py | 85 +++++++++++++++++++++--------- resources/lib/widgets.py | 2 +- 9 files changed, 136 insertions(+), 140 deletions(-) diff --git a/resources/lib/context_entry.py b/resources/lib/context_entry.py index 3d302dca..bbdd2c60 100644 --- a/resources/lib/context_entry.py +++ b/resources/lib/context_entry.py @@ -142,7 +142,7 @@ class ContextMenu(object): v.KODI_PLAYLIST_TYPE_FROM_KODI_TYPE[self.kodi_type]) playqueue.clear() app.PLAYSTATE.context_menu_play = True - handle = self.api.path(force_addon=True) + handle = self.api.fullpath(force_addon=True)[0] handle = 'RunPlugin(%s)' % handle xbmc.executebuiltin(handle.encode('utf-8')) diff --git a/resources/lib/itemtypes/movies.py b/resources/lib/itemtypes/movies.py index 971da6e6..1c17f395 100644 --- a/resources/lib/itemtypes/movies.py +++ b/resources/lib/itemtypes/movies.py @@ -5,7 +5,7 @@ from logging import getLogger from .common import ItemBase from ..plex_api import API -from .. import app, variables as v, plex_functions as PF, utils +from .. import app, variables as v, plex_functions as PF LOG = getLogger('PLEX.movies') @@ -36,35 +36,12 @@ class Movie(ItemBase): update_item = False kodi_id = self.kodidb.new_movie_id() - # GET THE FILE AND PATH ##### - do_indirect = not app.SYNC.direct_paths - if app.SYNC.direct_paths: - # Direct paths is set the Kodi way - playurl = api.file_path(force_first_media=True) - if playurl is None: - # Something went wrong, trying to use non-direct paths - do_indirect = True - else: - playurl = api.validate_playurl(playurl, api.plex_type) - if playurl is None: - return False - if '\\' in playurl: - # Local path - filename = playurl.rsplit("\\", 1)[1] - else: - # Network share - filename = playurl.rsplit("/", 1)[1] - path = utils.rreplace(playurl, filename, "", 1) - kodi_pathid = self.kodidb.add_path(path, - content='movies', - scraper='metadata.local') - if do_indirect: - # Set plugin path and media flags using real filename - filename = api.file_name(force_first_media=True) - path = 'plugin://%s.movies/' % v.ADDON_ID - filename = ('%s?plex_id=%s&plex_type=%s&mode=play&filename=%s' - % (path, plex_id, v.PLEX_TYPE_MOVIE, filename)) - playurl = filename + fullpath, path, filename = api.fullpath() + if app.SYNC.direct_paths and not fullpath.startswith('http'): + kodi_pathid = self.kodidb.add_path(path, + content='movies', + scraper='metadata.local') + else: kodi_pathid = self.kodidb.get_path(path) if update_item: @@ -150,7 +127,7 @@ class Movie(ItemBase): api.list_to_string(api.studios()), api.trailer(), api.list_to_string(api.countries()), - playurl, + fullpath, kodi_pathid, api.premiere_date(), api.userrating()) diff --git a/resources/lib/itemtypes/music.py b/resources/lib/itemtypes/music.py index 15b98bfa..7e2721cc 100644 --- a/resources/lib/itemtypes/music.py +++ b/resources/lib/itemtypes/music.py @@ -7,7 +7,7 @@ from .common import ItemBase from ..plex_api import API from ..plex_db import PlexDB, PLEXDB_LOCK from ..kodi_db import KodiMusicDB, KODIDB_LOCK -from .. import plex_functions as PF, db, timing, app, variables as v, utils +from .. import plex_functions as PF, db, timing, app, variables as v LOG = getLogger('PLEX.music') @@ -520,33 +520,7 @@ class Song(MusicMixin, ItemBase): if entry.tag == 'Mood': moods.append(entry.attrib['tag']) mood = api.list_to_string(moods) - - # GET THE FILE AND PATH ##### - do_indirect = not app.SYNC.direct_paths - if app.SYNC.direct_paths: - # Direct paths is set the Kodi way - playurl = api.file_path(force_first_media=True) - if playurl is None: - # Something went wrong, trying to use non-direct paths - do_indirect = True - else: - playurl = api.validate_playurl(playurl, api.plex_type) - if playurl is None: - return False - if "\\" in playurl: - # Local path - filename = playurl.rsplit("\\", 1)[1] - else: - # Network share - filename = playurl.rsplit("/", 1)[1] - path = utils.rreplace(playurl, filename, "", 1) - if do_indirect: - # Plex works a bit differently - path = "%s%s" % (app.CONN.server, xml[0][0].get('key')) - path = api.attach_plex_token_to_url(path) - filename = path.rsplit('/', 1)[1] - path = path.replace(filename, '') - + _, path, filename = api.fullpath() # UPDATE THE SONG ##### if update_item: LOG.info("UPDATE song plex_id: %s - %s", plex_id, title) diff --git a/resources/lib/itemtypes/tvshows.py b/resources/lib/itemtypes/tvshows.py index 50c25e49..f1b6ca46 100644 --- a/resources/lib/itemtypes/tvshows.py +++ b/resources/lib/itemtypes/tvshows.py @@ -5,7 +5,7 @@ from logging import getLogger from .common import ItemBase, process_path from ..plex_api import API -from .. import plex_functions as PF, app, variables as v, utils +from .. import plex_functions as PF, app, variables as v LOG = getLogger('PLEX.tvshows') @@ -420,43 +420,22 @@ class Episode(TvShowMixin, ItemBase): return parent_id = season['kodi_id'] if season else None - # GET THE FILE AND PATH ##### - do_indirect = not app.SYNC.direct_paths - if app.SYNC.direct_paths: - playurl = api.file_path(force_first_media=True) - if playurl is None: - do_indirect = True - else: - playurl = api.validate_playurl(playurl, v.PLEX_TYPE_EPISODE) - if "\\" in playurl: - # Local path - filename = playurl.rsplit("\\", 1)[1] - else: - # Network share - filename = playurl.rsplit("/", 1)[1] - path = utils.rreplace(playurl, filename, "", 1) - parent_path_id = self.kodidb.parent_path_id(path) - kodi_pathid = self.kodidb.add_path(path, - id_parent_path=parent_path_id) - if do_indirect: - # Set plugin path - do NOT use "intermediate" paths for the show - # as with direct paths! - filename = api.file_name(force_first_media=True) - path = 'plugin://%s.tvshows/%s/' % (v.ADDON_ID, api.show_id()) - filename = ('%s?plex_id=%s&plex_type=%s&mode=play&filename=%s' - % (path, plex_id, v.PLEX_TYPE_EPISODE, filename)) - playurl = filename + fullpath, path, filename = api.fullpath() + if app.SYNC.direct_paths and not fullpath.startswith('http'): + parent_path_id = self.kodidb.parent_path_id(path) + kodi_pathid = self.kodidb.add_path(path, + id_parent_path=parent_path_id) + else: # Root path tvshows/ already saved in Kodi DB kodi_pathid = self.kodidb.add_path(path) - if not app.SYNC.direct_paths: - # need to set a 2nd file entry for a path without plex show id - # This fixes e.g. context menu and widgets working as they - # should - # A dirty hack, really - path_2 = 'plugin://%s.tvshows/' % v.ADDON_ID - # filename_2 is exactly the same as filename - # so WITH plex show id! - kodi_pathid_2 = self.kodidb.add_path(path_2) + # need to set a 2nd file entry for a path without plex show id + # This fixes e.g. context menu and widgets working as they + # should + # A dirty hack, really + path_2 = 'plugin://%s.tvshows/' % v.ADDON_ID + # filename_2 is exactly the same as filename + # so WITH plex show id! + kodi_pathid_2 = self.kodidb.add_path(path_2) # UPDATE THE EPISODE ##### if update_item: @@ -512,7 +491,7 @@ class Episode(TvShowMixin, ItemBase): api.title(), airs_before_season, airs_before_episode, - playurl, + fullpath, kodi_pathid, uniqueid, kodi_fileid, # and NOT kodi_fileid_2 @@ -594,7 +573,7 @@ class Episode(TvShowMixin, ItemBase): grandparent_id, airs_before_season, airs_before_episode, - playurl, + fullpath, kodi_pathid, uniqueid, parent_id, diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index ba41cc4d..ad7749b5 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -575,7 +575,7 @@ def _notify_upnext(item): full_artwork=True) } _complete_artwork_keys(info[key]) - info['play_info'] = {'handle': next_api.path(force_addon=True)} + info['play_info'] = {'handle': next_api.fullpath(force_addon=True)[0]} sender = v.ADDON_ID.encode('utf-8') method = 'upnext_data'.encode('utf-8') data = binascii.hexlify(json.dumps(info)) diff --git a/resources/lib/playback.py b/resources/lib/playback.py index 2b30e741..310f8b0f 100644 --- a/resources/lib/playback.py +++ b/resources/lib/playback.py @@ -350,7 +350,7 @@ def _prep_playlist_stack(xml, resume): api.part = part if kodi_id is None: # Need to redirect again to PKC to conclude playback - path = api.path(force_addon=True, force_first_media=True) + path = api.fullpath(force_addon=True)[0] # Using different paths than the ones saved in the Kodi DB # fixes Kodi immediately resuming the video if one restarts # the same video again after playback diff --git a/resources/lib/playlists/kodi_pl.py b/resources/lib/playlists/kodi_pl.py index 8753326d..39cfa5de 100644 --- a/resources/lib/playlists/kodi_pl.py +++ b/resources/lib/playlists/kodi_pl.py @@ -117,21 +117,8 @@ def _write_playlist_to_file(playlist, xml): Returns None or raises PlaylistError """ text = '#EXTCPlayListM3U::M3U\n' - for element in xml: - api = API(element) - if api.plex_type == v.PLEX_TYPE_EPISODE: - if api.season_number() is not None and api.index() is not None: - text += ('#EXTINF:%s,%s S%.2dE%.2d - %s\n%s\n' - % (api.runtime(), api.show_title(), - api.season_number(), api.index(), - api.title(), api.path())) - else: - # Only append the TV show name - text += ('#EXTINF:%s,%s - %s\n%s\n' - % (api.runtime(), api.show_title(), api.title(), api.path())) - else: - text += ('#EXTINF:%s,%s\n%s\n' - % (api.runtime(), api.title(), api.path())) + for xml_element in xml: + text += _m3u_element(xml_element) text += '\n' text = text.encode(v.M3U_ENCODING, 'ignore') try: @@ -142,3 +129,45 @@ def _write_playlist_to_file(playlist, xml): LOG.error('Error message %s: %s', err.errno, err.strerror) raise PlaylistError('Cannot write Kodi playlist to path for %s' % playlist) + + +def _m3u_element(xml_element): + api = API(xml_element) + if api.plex_type == v.PLEX_TYPE_EPISODE: + if api.season_number() is not None and api.index() is not None: + return '#EXTINF:{},{} S{:2d}E{:2d} - {}\n{}\n'.format( + api.runtime(), + api.show_title(), + api.season_number(), + api.index(), + api.title(), + api.fullpath(force_addon=True)[0]) + else: + # Only append the TV show name + return '#EXTINF:{},{} - {}\n{}\n'.format( + api.runtime(), + api.show_title(), + api.title(), + api.fullpath(force_addon=True)[0]) + elif api.plex_type == v.PLEX_TYPE_SONG: + if api.index() is not None: + return '#EXTINF:{},{:02d}. {} - {}\n{}\n'.format( + api.runtime(), + api.index(), + api.grandparent_title(), + api.title(), + api.fullpath(force_first_media=True, + omit_check=True)[0]) + else: + return '#EXTINF:{},{} - {}\n{}\n'.format( + api.runtime(), + api.grandparent_title(), + api.title(), + api.fullpath(force_first_media=True, + omit_check=True)[0]) + else: + return '#EXTINF:{},{}\n{}\n'.format( + api.runtime(), + api.title(), + api.fullpath(force_first_media=True, + omit_check=True)[0]) diff --git a/resources/lib/plex_api/file.py b/resources/lib/plex_api/file.py index 51ef98f1..c3b561c9 100644 --- a/resources/lib/plex_api/file.py +++ b/resources/lib/plex_api/file.py @@ -41,43 +41,80 @@ def _transcode_image_path(key, AuthToken, path, width, height): class File(object): - def path(self, force_first_media=True, force_addon=False, - direct_paths=None): + def fullpath(self, force_first_media=True, force_addon=False, + direct_paths=None, omit_check=False, force_check=False): """ - 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. + Returns a "fully qualified path" add-on paths or direct paths + depending on the current settings as the tupple + (fullpath, path, filename) + as unicode. Add-on paths are returned as a fallback. Returns None + if something went wrong. - Pass direct_path=True if you're calling from another Plex python - instance - because otherwise direct paths will evaluate to False! + firce_first_media=False prompts the user to choose which version of the + media should be returned, if several are present + force_addon=True will always return the add-on path + direct_path=True if you're calling from another Plex python + instance - because otherwise direct paths will + evaluate to False! """ - direct_paths = direct_paths or app.SYNC.direct_paths - filename = self.file_path(force_first_media=force_first_media) + direct_paths = app.SYNC.direct_paths if direct_paths is None \ + else direct_paths if (not direct_paths or force_addon 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 + if self.plex_type == v.PLEX_TYPE_SONG: + return self._music_addon_paths(force_first_media) if self.plex_type == v.PLEX_TYPE_EPISODE: # need to include the plex show id in the path path = ('plugin://plugin.video.plexkodiconnect.tvshows/%s/' % self.grandparent_id()) else: path = 'plugin://%s/' % v.ADDON_TYPE[self.plex_type] - path = ('%s?plex_id=%s&plex_type=%s&mode=play&filename=%s' + # Filename in Kodi will end with actual filename - hopefully + # this is useful for other add-ons + filename = self.file_path(force_first_media=force_first_media) + try: + if '/' in filename: + filename = filename.rsplit('/', 1)[1] + else: + filename = filename.rsplit('\\', 1)[1] + except (TypeError, IndexError): + return + entirepath = ('%s?mode=play&plex_id=%s&plex_type=%s&filename=%s' % (path, self.plex_id, self.plex_type, filename)) + # For Kodi DB, we need to safe the ENTIRE path for filenames + filename = entirepath else: - # Direct paths is set the Kodi way - path = self.validate_playurl(filename, - self.plex_type, - omit_check=True) - return path + entirepath = self.validate_playurl( + self.file_path(force_first_media=force_first_media), + self.plex_type, + force_check=force_check, + omit_check=omit_check) + try: + if '/' in entirepath: + filename = entirepath.rsplit('/', 1)[1] + else: + filename = entirepath.rsplit('\\', 1)[1] + except (TypeError, IndexError): + # Fallback to add-on paths + return self.fullpath(force_first_media=force_first_media, + force_addon=True) + path = utils.rreplace(entirepath, filename, "", 1) + return entirepath, path, filename + + def _music_addon_paths(self, force_first_media): + """ + For songs only. Normal add-on paths plugin://... don't work with the + Kodi music DB, hence use a "direct" url to the music file on the PMS. + """ + if self.mediastream is None and force_first_media is False: + if self.mediastream_number() is None: + return + streamno = 0 if force_first_media else self.mediastream + entirepath = "%s%s" % (app.CONN.server, + self.xml[streamno][self.part].get('key')) + entirepath = self.attach_plex_token_to_url(entirepath) + path, filename = entirepath.rsplit('/', 1) + return entirepath, path + '/', filename def directory_path(self, section_id=None, plex_type=None, old_key=None, synched=True): diff --git a/resources/lib/widgets.py b/resources/lib/widgets.py index 368e2977..0252de12 100644 --- a/resources/lib/widgets.py +++ b/resources/lib/widgets.py @@ -223,7 +223,7 @@ def _generate_content(api): elif plex_type == v.PLEX_TYPE_PHOTO: url = api.get_picture_path() else: - url = api.path() + url = api.fullpath(force_first_media=True)[0] if not api.kodi_id and plex_type == v.PLEX_TYPE_EPISODE: # Hack - Item is not synched to the Kodi database # We CANNOT use paths that show up in the Kodi paths table! From 2f34ece3f545f81be6d1aa46486ed8ee10f1bd89 Mon Sep 17 00:00:00 2001 From: croneter Date: Thu, 27 Feb 2020 16:33:25 +0100 Subject: [PATCH 17/23] Beta version bump 2.11.2 --- README.md | 2 +- addon.xml | 7 +++++-- changelog.txt | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 11797aa7..794f04df 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![stable version](https://img.shields.io/badge/stable_version-2.10.12-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.11.1-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.11.2-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 dedc073e..dfc7bbb0 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -83,7 +83,10 @@ Natūralioji „Plex“ integracija į „Kodi“ Prijunkite „Kodi“ prie „Plex Medija Serverio“. Šiame papildinyje daroma prielaida, kad valdote visus savo vaizdo įrašus naudodami „Plex“ (ir nė vieno su „Kodi“). Galite prarasti jau saugomus „Kodi“ vaizdo įrašų ir muzikos duomenų bazių duomenis (kadangi šis papildinys juos tiesiogiai pakeičia). Naudokite savo pačių rizika! Naudokite savo pačių rizika - version 2.11.1 (beta only): + version 2.11.2 (beta only): +- Refactor direct and add-on paths. Enables use of Plex music playlists synched to Kodi + +version 2.11.1 (beta only): - Rewire the set-up of audio and subtitle streams, esp. before starting a transcoding session. Fixes playback not starting at all version 2.11.0 (beta only): diff --git a/changelog.txt b/changelog.txt index 956a2a84..55267d7d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +version 2.11.2 (beta only): +- Refactor direct and add-on paths. Enables use of Plex music playlists synched to Kodi + version 2.11.1 (beta only): - Rewire the set-up of audio and subtitle streams, esp. before starting a transcoding session. Fixes playback not starting at all From f573a29d37dee842e227d922cf16a927d2a14db6 Mon Sep 17 00:00:00 2001 From: croneter Date: Thu, 27 Feb 2020 16:38:53 +0100 Subject: [PATCH 18/23] Ensure we resync all Plex playlists to Kodi when updating PKC --- resources/lib/migration.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/lib/migration.py b/resources/lib/migration.py index 13ec7729..1aac3c11 100644 --- a/resources/lib/migration.py +++ b/resources/lib/migration.py @@ -84,4 +84,10 @@ def check_migration(): from . import library_sync library_sync.force_full_sync() + if not utils.compare_version(last_migration, '2.11.3'): + LOG.info('Migrating to version 2.11.2') + # Re-sync all playlists to Kodi + from .playlists import remove_synced_playlists + remove_synced_playlists() + utils.settings('last_migrated_PKC_version', value=v.ADDON_VERSION) From cd6a0f6fe4111fc612dc949bcfaeaf55d3cf1557 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 1 Mar 2020 13:41:23 +0100 Subject: [PATCH 19/23] Fix TypeError: 'NoneType' object has no attribute '__getitem__' --- resources/lib/plex_api/file.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/resources/lib/plex_api/file.py b/resources/lib/plex_api/file.py index c3b561c9..ece2de17 100644 --- a/resources/lib/plex_api/file.py +++ b/resources/lib/plex_api/file.py @@ -69,18 +69,24 @@ class File(object): % self.grandparent_id()) else: path = 'plugin://%s/' % v.ADDON_TYPE[self.plex_type] - # Filename in Kodi will end with actual filename - hopefully - # this is useful for other add-ons - filename = self.file_path(force_first_media=force_first_media) - try: - if '/' in filename: - filename = filename.rsplit('/', 1)[1] - else: - filename = filename.rsplit('\\', 1)[1] - except (TypeError, IndexError): - return - entirepath = ('%s?mode=play&plex_id=%s&plex_type=%s&filename=%s' - % (path, self.plex_id, self.plex_type, filename)) + if self.plex_type in (v.PLEX_TYPE_MOVIE, + v.PLEX_TYPE_CLIP, + v.PLEX_TYPE_EPISODE): + # Filename in Kodi will end with actual filename - hopefully + # this is useful for other add-ons + filename = self.file_path(force_first_media=force_first_media) + try: + if '/' in filename: + filename = filename.rsplit('/', 1)[1] + else: + filename = filename.rsplit('\\', 1)[1] + except (TypeError, IndexError): + return + entirepath = ('%s?mode=play&plex_id=%s&plex_type=%s&filename=%s' + % (path, self.plex_id, self.plex_type, filename)) + else: + entirepath = ('%s?mode=play&plex_id=%s&plex_type=%s' + % (path, self.plex_id, self.plex_type)) # For Kodi DB, we need to safe the ENTIRE path for filenames filename = entirepath else: From 4bc44001001e749263bd6b540f26e29ff7aa5a99 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 1 Mar 2020 13:50:44 +0100 Subject: [PATCH 20/23] Beta version bump 2.11.3 --- README.md | 2 +- addon.xml | 7 +++++-- changelog.txt | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 794f04df..6517e7e0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![stable version](https://img.shields.io/badge/stable_version-2.10.12-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.11.2-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.11.3-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 dfc7bbb0..0d153d30 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -83,7 +83,10 @@ Natūralioji „Plex“ integracija į „Kodi“ Prijunkite „Kodi“ prie „Plex Medija Serverio“. Šiame papildinyje daroma prielaida, kad valdote visus savo vaizdo įrašus naudodami „Plex“ (ir nė vieno su „Kodi“). Galite prarasti jau saugomus „Kodi“ vaizdo įrašų ir muzikos duomenų bazių duomenis (kadangi šis papildinys juos tiesiogiai pakeičia). Naudokite savo pačių rizika! Naudokite savo pačių rizika - version 2.11.2 (beta only): + version 2.11.3 (beta only): +- Fix TypeError: 'NoneType' object has no attribute '__getitem__', e.g. when displaying albums + +version 2.11.2 (beta only): - Refactor direct and add-on paths. Enables use of Plex music playlists synched to Kodi version 2.11.1 (beta only): diff --git a/changelog.txt b/changelog.txt index 55267d7d..44a9aacf 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +version 2.11.3 (beta only): +- Fix TypeError: 'NoneType' object has no attribute '__getitem__', e.g. when displaying albums + version 2.11.2 (beta only): - Refactor direct and add-on paths. Enables use of Plex music playlists synched to Kodi From 403c34826c479e723b8084974d387accd7a4e468 Mon Sep 17 00:00:00 2001 From: croneter Date: Tue, 3 Mar 2020 11:34:54 +0100 Subject: [PATCH 21/23] Fix another TypeError: 'NoneType' object has no attribute '__getitem__' --- resources/lib/plex_api/file.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/resources/lib/plex_api/file.py b/resources/lib/plex_api/file.py index ece2de17..78ec31a9 100644 --- a/resources/lib/plex_api/file.py +++ b/resources/lib/plex_api/file.py @@ -69,22 +69,18 @@ class File(object): % self.grandparent_id()) else: path = 'plugin://%s/' % v.ADDON_TYPE[self.plex_type] - if self.plex_type in (v.PLEX_TYPE_MOVIE, - v.PLEX_TYPE_CLIP, - v.PLEX_TYPE_EPISODE): - # Filename in Kodi will end with actual filename - hopefully - # this is useful for other add-ons - filename = self.file_path(force_first_media=force_first_media) - try: - if '/' in filename: - filename = filename.rsplit('/', 1)[1] - else: - filename = filename.rsplit('\\', 1)[1] - except (TypeError, IndexError): - return + # Filename in Kodi will end with actual filename - hopefully + # this is useful for other add-ons + filename = self.file_path(force_first_media=force_first_media) + if filename: + if '/' in filename: + filename = filename.rsplit('/', 1)[1] + else: + filename = filename.rsplit('\\', 1)[1] entirepath = ('%s?mode=play&plex_id=%s&plex_type=%s&filename=%s' % (path, self.plex_id, self.plex_type, filename)) else: + # E.g. clips or albums entirepath = ('%s?mode=play&plex_id=%s&plex_type=%s' % (path, self.plex_id, self.plex_type)) # For Kodi DB, we need to safe the ENTIRE path for filenames From 5459f6ce9a65d75d98c8b3c2805b356bd747e835 Mon Sep 17 00:00:00 2001 From: croneter Date: Tue, 3 Mar 2020 11:46:47 +0100 Subject: [PATCH 22/23] Beta version bump 2.11.4 --- README.md | 2 +- addon.xml | 7 +++++-- changelog.txt | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6517e7e0..329f6a9f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![stable version](https://img.shields.io/badge/stable_version-2.10.12-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.11.3-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.11.4-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 0d153d30..15e7a833 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -83,7 +83,10 @@ Natūralioji „Plex“ integracija į „Kodi“ Prijunkite „Kodi“ prie „Plex Medija Serverio“. Šiame papildinyje daroma prielaida, kad valdote visus savo vaizdo įrašus naudodami „Plex“ (ir nė vieno su „Kodi“). Galite prarasti jau saugomus „Kodi“ vaizdo įrašų ir muzikos duomenų bazių duomenis (kadangi šis papildinys juos tiesiogiai pakeičia). Naudokite savo pačių rizika! Naudokite savo pačių rizika - version 2.11.3 (beta only): + version 2.11.4 (beta only): +- Fix another TypeError: 'NoneType' object has no attribute '__getitem__', e.g. when trying to play trailers + +version 2.11.3 (beta only): - Fix TypeError: 'NoneType' object has no attribute '__getitem__', e.g. when displaying albums version 2.11.2 (beta only): diff --git a/changelog.txt b/changelog.txt index 44a9aacf..c3985c43 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +version 2.11.4 (beta only): +- Fix another TypeError: 'NoneType' object has no attribute '__getitem__', e.g. when trying to play trailers + version 2.11.3 (beta only): - Fix TypeError: 'NoneType' object has no attribute '__getitem__', e.g. when displaying albums From d1c6807ce6e8c1f35b7cfb576ff5225dacd3ce75 Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 13 Mar 2020 07:33:49 +0100 Subject: [PATCH 23/23] Stable and beta version bump 2.11.5 --- README.md | 4 ++-- addon.xml | 7 +++++-- changelog.txt | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 329f6a9f..a86be5bc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![stable version](https://img.shields.io/badge/stable_version-2.10.12-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.11.4-red.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/beta/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-1.0.2.zip) +[![stable version](https://img.shields.io/badge/stable_version-2.11.5-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.11.5-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 15e7a833..40cf085c 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + @@ -83,7 +83,10 @@ Natūralioji „Plex“ integracija į „Kodi“ Prijunkite „Kodi“ prie „Plex Medija Serverio“. Šiame papildinyje daroma prielaida, kad valdote visus savo vaizdo įrašus naudodami „Plex“ (ir nė vieno su „Kodi“). Galite prarasti jau saugomus „Kodi“ vaizdo įrašų ir muzikos duomenų bazių duomenis (kadangi šis papildinys juos tiesiogiai pakeičia). Naudokite savo pačių rizika! Naudokite savo pačių rizika - version 2.11.4 (beta only): + version 2.11.5: +- Versions 2.11.0-2.11.4 for everyone + +version 2.11.4 (beta only): - Fix another TypeError: 'NoneType' object has no attribute '__getitem__', e.g. when trying to play trailers version 2.11.3 (beta only): diff --git a/changelog.txt b/changelog.txt index c3985c43..819508dd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +version 2.11.5: +- Versions 2.11.0-2.11.4 for everyone + version 2.11.4 (beta only): - Fix another TypeError: 'NoneType' object has no attribute '__getitem__', e.g. when trying to play trailers