From 7bb469702a404ffca72acce5e18284816a9dacdd Mon Sep 17 00:00:00 2001 From: croneter Date: Sat, 17 Aug 2019 13:00:02 +0200 Subject: [PATCH] Fix wording: "direct path" is not "direct play" --- .../language/resource.language.en_gb/strings.po | 2 +- resources/lib/playlist_func.py | 2 +- resources/lib/playutils.py | 15 ++++++++------- resources/lib/plex_api/media.py | 2 +- resources/settings.xml | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 89235c96..d8e3484c 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -963,7 +963,7 @@ msgstr "" # PKC Settings - Customize paths msgctxt "#39056" -msgid "Used by Sync and when attempting to Direct Play" +msgid "Used by Sync and when attempting to use Direct Paths" msgstr "" # PKC Settings, category name diff --git a/resources/lib/playlist_func.py b/resources/lib/playlist_func.py index 6c611adc..7b93b587 100644 --- a/resources/lib/playlist_func.py +++ b/resources/lib/playlist_func.py @@ -158,7 +158,7 @@ class PlaylistItem(object): uri = None [str] PMS path to item; will be auto-set with plex_id guid = None [str] Weird Plex guid xml = None [etree] XML from PMS, 1 lvl below - playmethod = None [str] either 'DirectPlay', 'DirectStream', 'Transcode' + playmethod = None [str] either 'DirectPath', 'DirectStream', 'Transcode' playcount = None [int] how many times the item has already been played offset = None [int] the item's view offset UPON START in Plex time part = 0 [int] part number if Plex video consists of mult. parts diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index 4a06c6e6..b45ccf91 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -29,10 +29,10 @@ class PlayUtils(): """ if self.api.mediastream_number() is None: return - playurl = self.isDirectPlay() + playurl = self.direct_path() if playurl is not None: LOG.info("File is direct playing.") - self.item.playmethod = 'DirectPlay' + self.item.playmethod = 'DirectPath' elif self.isDirectStream(): LOG.info("File is direct streaming.") playurl = self.api.transcode_video_path('DirectStream') @@ -53,9 +53,10 @@ class PlayUtils(): self.item.file = playurl return playurl - def isDirectPlay(self): + def direct_path(self): """ - Returns the path/playurl if we can direct play, None otherwise + Returns the path if we can use direct paths and the path is accessible + Returns None otherwise """ # True for e.g. plex.tv watch later if self.api.should_stream() is True: @@ -68,11 +69,11 @@ class PlayUtils(): return self.api.validate_playurl(path, self.api.plex_type, force_check=True) - # set to either 'Direct Stream=1' or 'Transcode=2' - # and NOT to 'Direct Play=0' + # set to either 'Direct Play=1' or 'Transcode=2' + # and NOT to 'Try Direct Path=0' if utils.settings('playType') != "0": # User forcing to play via HTTP - LOG.info("User chose to not direct play") + LOG.info("User chose to not use direct paths") return if self.mustTranscode(): return diff --git a/resources/lib/plex_api/media.py b/resources/lib/plex_api/media.py index cf192864..3bd23188 100644 --- a/resources/lib/plex_api/media.py +++ b/resources/lib/plex_api/media.py @@ -226,7 +226,7 @@ class Media(object): return quality = {} if quality is None else quality xargs = clientinfo.getXArgsDeviceInfo() - # For DirectPlay, path/key of PART is needed + # For DirectPath, path/key of PART is needed # trailers are 'clip' with PMS xmls if action == "DirectStream": path = self.xml[self.mediastream][self.part].get('key') diff --git a/resources/settings.xml b/resources/settings.xml index c5c70565..13ec7e10 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -111,7 +111,7 @@ - +