diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa05e87f2..9502af29a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,14 +98,12 @@ jobs: New-Item -Path "nginx/logs/__keep__.txt" -ItemType File -Force Invoke-WebRequest -Uri "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" -OutFile "MoviePilot-Plugins-main.zip" Expand-Archive -Path "MoviePilot-Plugins-main.zip" -DestinationPath "MoviePilot-Plugins-main" - Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/" + Move-Item -Path "MoviePilot-Plugins-main/MoviePilot-Plugins-main/plugins/*" -Destination "app/plugins/" -Force Remove-Item -Path "MoviePilot-Plugins-main.zip" Remove-Item -Path "MoviePilot-Plugins-main" -Recurse -Force Invoke-WebRequest -Uri "https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip" -OutFile "MoviePilot-Resources-main.zip" Expand-Archive -Path "MoviePilot-Resources-main.zip" -DestinationPath "MoviePilot-Resources-main" - Move-Item -Path "MoviePilot-Resources-main/MoviePilot-Resources-main/resources/*" -Destination "app/helper/" - New-Item -Path "config/sites" -ItemType Directory -Force - Move-Item -Path "app/helper/user.sites.bin" -Destination "config/sites/user.sites.bin" -Force + Move-Item -Path "MoviePilot-Resources-main/MoviePilot-Resources-main/resources/*" -Destination "app/helper/" -Force Remove-Item -Path "MoviePilot-Resources-main.zip" Remove-Item -Path "MoviePilot-Resources-main" -Recurse -Force shell: pwsh diff --git a/Dockerfile b/Dockerfile index a37fe642b..e154d370e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -78,13 +78,10 @@ RUN cp -f /app/nginx.conf /etc/nginx/nginx.template.conf \ && curl -sL "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${FRONTEND_VERSION}/dist.zip" | busybox unzip -d / - \ && mv /dist /public \ && curl -sL "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" | busybox unzip -d / - \ - && mv /MoviePilot-Plugins-main/plugins/* /app/app/plugins/ \ + && mv -f /MoviePilot-Plugins-main/plugins/* /app/app/plugins/ \ && rm -rf /MoviePilot-Plugins-main \ && curl -sL "https://github.com/jxxghp/MoviePilot-Resources/archive/refs/heads/main.zip" | busybox unzip -d / - \ - && mv /MoviePilot-Resources-main/resources/* /app/app/helper/ \ - && rm -f /app/config/user.sites.bin \ - && mkdir -p /app/config/sites \ - && mv /app/app/helper/user.sites.bin /app/config/sites/user.sites.bin \ + && mv -f /MoviePilot-Resources-main/resources/* /app/app/helper/ \ && rm -rf /MoviePilot-Resources-main EXPOSE 3000 VOLUME [ "/config" ] diff --git a/app/helper/plugin.py b/app/helper/plugin.py index b7648cd36..9e24e3c76 100644 --- a/app/helper/plugin.py +++ b/app/helper/plugin.py @@ -82,7 +82,9 @@ def install(pid: str, repo_url: str) -> Tuple[bool, str]: if item.get("download_url"): # 下载插件文件 res = RequestUtils(proxies=settings.PROXY).get_res(item["download_url"]) - if not res or res.status_code != 200: + if not res: + return False, f"文件 {item.get('name')} 下载失败!" + elif res.status_code != 200: return False, f"下载文件 {item.get('name')} 失败:{res.status_code} - {res.reason}" # 创建插件文件夹 file_path = Path(settings.ROOT_PATH) / "app" / item.get("path") diff --git a/update b/update index e17dba6b9..6408d478c 100644 --- a/update +++ b/update @@ -40,10 +40,8 @@ install_backend_and_download_resources() { mv /tmp/App /app rm -rf /public mv /tmp/dist /public - mv /tmp/Plugins/plugins/* /app/app/plugins/ - mv /tmp/Resources/resources/* /app/app/helper/ - mkdir -p /app/config/sites - mv /app/app/helper/user.sites.bin /app/config/sites/user.sites.bin + mv -f /tmp/Plugins/plugins/* /app/app/plugins/ + mv -f /tmp/Resources/resources/* /app/app/helper/ rm -rf /tmp/* echo "程序更新成功,前端版本:${frontend_version},后端版本:${1}" else