From 890db89de6b77250d55bdb6df6c57e9e66b8c5e5 Mon Sep 17 00:00:00 2001 From: Stephan Sundermann Date: Thu, 3 Oct 2024 02:39:57 +0200 Subject: [PATCH] Add client native mode path replacement --- jellyfin_kodi/helper/api.py | 10 ++++++++++ resources/language/resource.language.en_gb/strings.po | 8 ++++++++ resources/settings.xml | 2 ++ 3 files changed, 20 insertions(+) diff --git a/jellyfin_kodi/helper/api.py b/jellyfin_kodi/helper/api.py index 0174c3edb..56df8dc88 100644 --- a/jellyfin_kodi/helper/api.py +++ b/jellyfin_kodi/helper/api.py @@ -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) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index d44a37b1e..0645cae28 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -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" diff --git a/resources/settings.xml b/resources/settings.xml index 91bc5f83e..2d7a8e2ea 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -24,6 +24,8 @@ + +