mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-16 06:15:07 +00:00
Merge d96c22a9e9
into 533e7368c9
This commit is contained in:
commit
ad528e02f5
1 changed files with 18 additions and 1 deletions
|
@ -6,6 +6,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
from . import settings, LazyLogger
|
from . import settings, LazyLogger
|
||||||
from .utils import translate_path
|
from .utils import translate_path
|
||||||
import json
|
import json
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
@ -245,7 +246,23 @@ class API(object):
|
||||||
for local_path in self.path_data.keys():
|
for local_path in self.path_data.keys():
|
||||||
if local_path in path:
|
if local_path in path:
|
||||||
path = path.replace(local_path, self.path_data[local_path])
|
path = path.replace(local_path, self.path_data[local_path])
|
||||||
|
# URL standardization
|
||||||
|
if (
|
||||||
|
"davs://" in path.lower()
|
||||||
|
or "dav://" in path.lower()
|
||||||
|
or "http://" in path.lower()
|
||||||
|
or "https://" in path.lower()
|
||||||
|
):
|
||||||
|
protocol, rest = path.split("://", 1)
|
||||||
|
ends_with_slash = rest.endswith("/") # 记录是否以/结尾
|
||||||
|
if "/" in rest:
|
||||||
|
host, path_part = rest.split("/", 1)
|
||||||
|
path_part = "/".join(
|
||||||
|
urllib.parse.quote(segment) for segment in path_part.split("/")
|
||||||
|
)
|
||||||
|
path = f"{protocol}://{host}/{path_part}"
|
||||||
|
if ends_with_slash and not path.endswith("/"):
|
||||||
|
path += "/"
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def get_user_artwork(self, user_id):
|
def get_user_artwork(self, user_id):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue