mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-07 09:58:47 +00:00
When the path is a directory, append / after path normalization.
This commit is contained in:
parent
56ac6438c7
commit
d96c22a9e9
1 changed files with 4 additions and 0 deletions
|
@ -7,6 +7,7 @@ from . import settings, LazyLogger
|
|||
from .utils import translate_path
|
||||
import json
|
||||
import urllib.parse
|
||||
|
||||
##################################################################################################
|
||||
|
||||
LOG = LazyLogger(__name__)
|
||||
|
@ -253,12 +254,15 @@ class API(object):
|
|||
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
|
||||
|
||||
def get_user_artwork(self, user_id):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue