Skip to content

Commit

Permalink
Add client native mode path replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
sundermann committed Oct 3, 2024
1 parent 1637658 commit 890db89
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jellyfin_kodi/helper/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,16 @@ def get_file_path(self, path=None):
if not path:
return ""

replace = settings("directPathReplace")
replace_with = settings("directPathReplaceWith")
if (
settings("useDirectPaths") == "1"
and replace
and replace_with
and path.startswith(replace)
):
path = path.replace(replace, replace_with, 1)

if path.startswith("\\\\"):
path = (
path.replace("\\\\", "smb://", 1)
Expand Down
8 changes: 8 additions & 0 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -996,3 +996,11 @@ msgstr "Max artwork resolution"
msgctxt "#33202"
msgid "Transcode H265/HEVC RExt"
msgstr "Transcode H265/HEVC RExt"

msgctxt "#33203"
msgid "Native path to replace"
msgstr "Native path to replace"

msgctxt "#33204"
msgid "Native path to replace with"
msgstr "Native path replace with"
2 changes: 2 additions & 0 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<setting label="30536" id="dbSyncScreensaver" type="bool" default="true" />
<setting label="33111" type="lsep" />
<setting label="30511" id="useDirectPaths" type="enum" lvalues="33036|33037" default="1" />
<setting label="33203" id="directPathReplace" type="text" default="" />
<setting label="33204" id="directPathReplaceWith" type="folder" source="" default="" />

<setting label="33175" type="lsep" />
<setting label="30515" id="limitIndex" type="slider" default="15" range="1, 1, 100" option="int" />
Expand Down

0 comments on commit 890db89

Please sign in to comment.