mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-09 05:16:56 +08:00
fix: restore full test suite
This commit is contained in:
@@ -122,6 +122,8 @@
|
||||
"刮削路径不存在": "Scraping path does not exist",
|
||||
"保存成功": "Saved successfully",
|
||||
"保存失败": "Failed to save",
|
||||
"保存MCP配置成功": "MCP configuration saved successfully",
|
||||
"保存MCP配置失败": "Failed to save MCP configuration",
|
||||
"参数错误": "Invalid parameters",
|
||||
"未配置媒体服务器": "Media server is not configured",
|
||||
"未找到播放地址": "Playback URL not found",
|
||||
@@ -402,6 +404,10 @@
|
||||
"source": "获取工具Schema失败: {reason}",
|
||||
"target": "Failed to get tool schema: {reason}"
|
||||
},
|
||||
{
|
||||
"source": "测试MCP服务器失败: {reason}",
|
||||
"target": "Failed to test MCP server: {reason}"
|
||||
},
|
||||
{
|
||||
"source": "插件 {plugin} 不存在或未安装",
|
||||
"target": "Plugin {plugin} does not exist or is not installed"
|
||||
|
||||
@@ -102,6 +102,8 @@
|
||||
"豆瓣网络连接失败": "豆瓣网络连接失败",
|
||||
"Bangumi网络连接失败": "Bangumi网络连接失败",
|
||||
"fanart网络连接失败": "fanart网络连接失败",
|
||||
"保存MCP配置成功": "保存MCP配置成功",
|
||||
"保存MCP配置失败": "保存MCP配置失败",
|
||||
"未配置站点或未通过用户认证": "未配置站点或未通过用户认证",
|
||||
"Redis连接失败,请检查配置": "Redis连接失败,请检查配置"
|
||||
},
|
||||
@@ -181,6 +183,10 @@
|
||||
{
|
||||
"source": "{domain} 网络连接失败",
|
||||
"target": "{domain} 网络连接失败"
|
||||
},
|
||||
{
|
||||
"source": "测试MCP服务器失败: {reason}",
|
||||
"target": "测试MCP服务器失败: {reason}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -122,6 +122,8 @@
|
||||
"刮削路径不存在": "刮削路徑不存在",
|
||||
"保存成功": "儲存成功",
|
||||
"保存失败": "儲存失敗",
|
||||
"保存MCP配置成功": "MCP 設定儲存成功",
|
||||
"保存MCP配置失败": "MCP 設定儲存失敗",
|
||||
"参数错误": "參數錯誤",
|
||||
"未配置媒体服务器": "未設定媒體伺服器",
|
||||
"未找到播放地址": "未找到播放位址",
|
||||
@@ -402,6 +404,10 @@
|
||||
"source": "获取工具Schema失败: {reason}",
|
||||
"target": "取得工具 Schema 失敗: {reason}"
|
||||
},
|
||||
{
|
||||
"source": "测试MCP服务器失败: {reason}",
|
||||
"target": "測試 MCP 伺服器失敗: {reason}"
|
||||
},
|
||||
{
|
||||
"source": "插件 {plugin} 不存在或未安装",
|
||||
"target": "插件 {plugin} 不存在或未安裝"
|
||||
|
||||
@@ -20,6 +20,16 @@ function WARN() {
|
||||
echo -e "${WARN} ${1}"
|
||||
}
|
||||
|
||||
function normalize_env_value() {
|
||||
printf '%s' "${1:-}" | tr '[:upper:]' '[:lower:]'
|
||||
}
|
||||
|
||||
function is_truthy_value() {
|
||||
local value
|
||||
value="$(normalize_env_value "${1:-}")"
|
||||
[ "${value}" = "true" ] || [ "${value}" = "1" ] || [ "${value}" = "yes" ]
|
||||
}
|
||||
|
||||
# 设置虚拟环境路径(兼容群晖等系统必须这样配置)
|
||||
VENV_PATH="${VENV_PATH:-/opt/venv}"
|
||||
export PATH="${VENV_PATH}/bin:$PATH"
|
||||
@@ -262,8 +272,8 @@ function graceful_exit() {
|
||||
# 后端异常退出时默认保留容器,避免无法 docker exec 进入容器运行 doctor。
|
||||
function diagnostic_keepalive() {
|
||||
local exit_code=${1:-1}
|
||||
local keepalive="${MOVIEPILOT_DOCKER_KEEPALIVE_ON_FAILURE:-true}"
|
||||
keepalive="${keepalive,,}"
|
||||
local keepalive
|
||||
keepalive="$(normalize_env_value "${MOVIEPILOT_DOCKER_KEEPALIVE_ON_FAILURE:-true}")"
|
||||
|
||||
if [ "${keepalive}" = "false" ] || [ "${keepalive}" = "0" ] || [ "${keepalive}" = "no" ]; then
|
||||
graceful_exit "$exit_code" "python_exit"
|
||||
@@ -316,11 +326,14 @@ function ensure_backend_runtime_dependencies() {
|
||||
INFO "→ 已自动恢复主程序依赖,继续启动后端。"
|
||||
}
|
||||
|
||||
function force_chown_image_paths_if_requested() {
|
||||
local force="${MOVIEPILOT_FORCE_CHOWN:-false}"
|
||||
force="${force,,}"
|
||||
function path_owner_id() {
|
||||
local target="${1:-}"
|
||||
[ -n "${target}" ] || return 0
|
||||
stat -c '%u:%g' "${target}" 2>/dev/null || stat -f '%u:%g' "${target}" 2>/dev/null || true
|
||||
}
|
||||
|
||||
if [ "${force}" != "true" ] && [ "${force}" != "1" ] && [ "${force}" != "yes" ]; then
|
||||
function force_chown_image_paths_if_requested() {
|
||||
if ! is_truthy_value "${MOVIEPILOT_FORCE_CHOWN:-false}"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
@@ -336,13 +349,10 @@ function force_chown_image_paths_if_requested() {
|
||||
function correct_home_permissions() {
|
||||
[ -e "${HOME}" ] || return 0
|
||||
|
||||
local force="${MOVIEPILOT_FORCE_CHOWN:-false}"
|
||||
force="${force,,}"
|
||||
|
||||
chown moviepilot:moviepilot "${HOME}"
|
||||
[ -e "${HOME}/.cloakbrowser" ] && chown -h moviepilot:moviepilot "${HOME}/.cloakbrowser"
|
||||
|
||||
if [ "${force}" = "true" ] || [ "${force}" = "1" ] || [ "${force}" = "yes" ]; then
|
||||
if is_truthy_value "${MOVIEPILOT_FORCE_CHOWN:-false}"; then
|
||||
[ -e "${HOME}/.cloakbrowser" ] && chown -R moviepilot:moviepilot "${HOME}/.cloakbrowser"
|
||||
elif [ -e "${HOME}/.cloakbrowser" ]; then
|
||||
INFO "→ 默认跳过 ${HOME}/.cloakbrowser 递归权限校正,如遇浏览器缓存权限错误可设置 MOVIEPILOT_FORCE_CHOWN=true 后重启一次。"
|
||||
@@ -356,7 +366,7 @@ function chown_plugin_runtime_path() {
|
||||
[ -n "${plugin_path}" ] || return 0
|
||||
[ -e "${plugin_path}" ] || return 0
|
||||
local current_owner
|
||||
current_owner="$(stat -c '%u:%g' "${plugin_path}" 2>/dev/null || true)"
|
||||
current_owner="$(path_owner_id "${plugin_path}")"
|
||||
[ "${current_owner}" = "${PUID}:${PGID}" ] && return 0
|
||||
chown -h moviepilot:moviepilot "${plugin_path}"
|
||||
}
|
||||
@@ -427,7 +437,7 @@ ensure_backend_runtime_dependencies
|
||||
# 下载浏览器内核
|
||||
function install_browser_kernel() {
|
||||
local emulation="${BROWSER_EMULATION:-cloakbrowser}"
|
||||
emulation="${emulation,,}"
|
||||
emulation="$(normalize_env_value "${emulation}")"
|
||||
local proxy="${HTTPS_PROXY:-${https_proxy:-$PROXY_HOST}}"
|
||||
|
||||
if [ "${emulation}" != "cloakbrowser" ] && [ "${emulation}" != "flaresolverr" ] && [ -n "${emulation}" ]; then
|
||||
|
||||
Reference in New Issue
Block a user