mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-20 03:57:30 +08:00
Merge pull request #5556 from YuF-9468/fix/5554-plugin-remote-entry-prefix
This commit is contained in:
@@ -5,6 +5,7 @@ import concurrent.futures
|
|||||||
import importlib.util
|
import importlib.util
|
||||||
import inspect
|
import inspect
|
||||||
import os
|
import os
|
||||||
|
import posixpath
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
@@ -775,11 +776,19 @@ class PluginManager(ConfigReloadMixin, metaclass=Singleton):
|
|||||||
:param dist_path: 插件的分发路径
|
:param dist_path: 插件的分发路径
|
||||||
:return: 远程入口地址
|
:return: 远程入口地址
|
||||||
"""
|
"""
|
||||||
if dist_path.startswith("/"):
|
dist_path = dist_path.strip("/")
|
||||||
dist_path = dist_path[1:]
|
api_prefix = settings.API_V1_STR.rstrip("/")
|
||||||
if dist_path.endswith("/"):
|
path = posixpath.join(
|
||||||
dist_path = dist_path[:-1]
|
api_prefix,
|
||||||
return f"/plugin/file/{plugin_id.lower()}/{dist_path}/remoteEntry.js"
|
"plugin",
|
||||||
|
"file",
|
||||||
|
plugin_id.lower(),
|
||||||
|
dist_path,
|
||||||
|
"remoteEntry.js",
|
||||||
|
)
|
||||||
|
if not path.startswith("/"):
|
||||||
|
path = "/" + path
|
||||||
|
return path
|
||||||
|
|
||||||
def get_plugin_remotes(self, pid: Optional[str] = None) -> List[Dict[str, Any]]:
|
def get_plugin_remotes(self, pid: Optional[str] = None) -> List[Dict[str, Any]]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user