mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
Merge remote-tracking branch 'origin/v2' into v2
This commit is contained in:
@@ -1,9 +1,14 @@
|
|||||||
name: MoviePilot Builder
|
name: MoviePilot Builder v2
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- v2
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/build.yml'
|
||||||
|
- 'Dockerfile'
|
||||||
|
- 'version.py'
|
||||||
|
- 'requirements.in'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Docker-build:
|
Docker-build:
|
||||||
@@ -23,9 +28,10 @@ jobs:
|
|||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ secrets.DOCKER_USERNAME }}/moviepilot
|
images: ${{ secrets.DOCKER_USERNAME }}/moviepilot-v2
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=${{ env.app_version }}
|
type=raw,value=${{ env.app_version }}
|
||||||
|
type=raw,value=latest
|
||||||
|
|
||||||
- name: Set Up QEMU
|
- name: Set Up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
@@ -52,3 +58,21 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=gha, scope=${{ github.workflow }}-docker
|
cache-from: type=gha, scope=${{ github.workflow }}-docker
|
||||||
cache-to: type=gha, scope=${{ github.workflow }}-docker
|
cache-to: type=gha, scope=${{ github.workflow }}-docker
|
||||||
|
|
||||||
|
- name: Delete Release
|
||||||
|
uses: dev-drprasad/delete-tag-and-release@v1.1
|
||||||
|
with:
|
||||||
|
tag_name: ${{ env.app_version }}
|
||||||
|
delete_release: true
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Generate Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
tag_name: ${{ env.app_version }}
|
||||||
|
name: ${{ env.app_version }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
make_latest: false
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
+2
-1
@@ -79,7 +79,8 @@ RUN cp -f /app/nginx.conf /etc/nginx/nginx.template.conf \
|
|||||||
&& echo 'fs.inotify.max_user_watches=5242880' >> /etc/sysctl.conf \
|
&& echo 'fs.inotify.max_user_watches=5242880' >> /etc/sysctl.conf \
|
||||||
&& echo 'fs.inotify.max_user_instances=5242880' >> /etc/sysctl.conf \
|
&& echo 'fs.inotify.max_user_instances=5242880' >> /etc/sysctl.conf \
|
||||||
&& locale-gen zh_CN.UTF-8 \
|
&& locale-gen zh_CN.UTF-8 \
|
||||||
&& curl -sL "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/dev_v2.0.0-alpha/dist.zip" | busybox unzip -d / - \
|
&& FRONTEND_VERSION=$(sed -n "s/^FRONTEND_VERSION\s*=\s*'\([^']*\)'/\1/p" /app/version.py) \
|
||||||
|
&& curl -sL "https://github.com/jxxghp/MoviePilot-Frontend/releases/download/${FRONTEND_VERSION}/dist.zip" | busybox unzip -d / - \
|
||||||
&& mv /dist /public \
|
&& mv /dist /public \
|
||||||
&& curl -sL "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" | busybox unzip -d /tmp - \
|
&& curl -sL "https://github.com/jxxghp/MoviePilot-Plugins/archive/refs/heads/main.zip" | busybox unzip -d /tmp - \
|
||||||
&& mv -f /tmp/MoviePilot-Plugins-main/plugins.v2/* /app/app/plugins/ \
|
&& mv -f /tmp/MoviePilot-Plugins-main/plugins.v2/* /app/app/plugins/ \
|
||||||
|
|||||||
@@ -786,12 +786,18 @@ class FileManagerModule(_ModuleBase):
|
|||||||
if not target_dir.media_type and target_dir.library_type_folder:
|
if not target_dir.media_type and target_dir.library_type_folder:
|
||||||
# 一级自动分类
|
# 一级自动分类
|
||||||
library_dir = Path(target_dir.library_path) / mediainfo.type.value
|
library_dir = Path(target_dir.library_path) / mediainfo.type.value
|
||||||
|
elif target_dir.media_type and target_dir.library_type_folder:
|
||||||
|
# 一级手动分类
|
||||||
|
library_dir = Path(target_dir.library_path) / target_dir.media_type
|
||||||
else:
|
else:
|
||||||
library_dir = Path(target_dir.library_path)
|
library_dir = Path(target_dir.library_path)
|
||||||
|
|
||||||
if not target_dir.media_category and target_dir.library_category_folder and mediainfo.category:
|
if not target_dir.media_category and target_dir.library_category_folder and mediainfo.category:
|
||||||
# 二级自动分类
|
# 二级自动分类
|
||||||
library_dir = library_dir / mediainfo.category
|
library_dir = library_dir / mediainfo.category
|
||||||
|
elif target_dir.media_category and target_dir.library_category_folder:
|
||||||
|
# 二级手动分类
|
||||||
|
library_dir = library_dir / target_dir.media_category
|
||||||
|
|
||||||
return library_dir
|
return library_dir
|
||||||
|
|
||||||
|
|||||||
@@ -415,7 +415,6 @@ class Monitor(metaclass=Singleton):
|
|||||||
mediainfo=mediainfo,
|
mediainfo=mediainfo,
|
||||||
transfer_type=dir_info.transfer_type,
|
transfer_type=dir_info.transfer_type,
|
||||||
target_storage=dir_info.library_storage,
|
target_storage=dir_info.library_storage,
|
||||||
target_path=Path(dir_info.library_path),
|
|
||||||
episodes_info=episodes_info,
|
episodes_info=episodes_info,
|
||||||
scrape=dir_info.scraping)
|
scrape=dir_info.scraping)
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,8 @@ function install_backend_and_download_resources() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
INFO "安装依赖成功"
|
INFO "安装依赖成功"
|
||||||
frontend_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot-Frontend/releases/latest" ${CURL_HEADERS} | jq -r .tag_name)
|
# 从后端文件中读取前端版本号
|
||||||
|
frontend_version=$(grep -oP "(?<=FRONTEND_VERSION\s*=\s*')[^']+" /tm/App/version.py)
|
||||||
if [[ "${frontend_version}" != *v* ]]; then
|
if [[ "${frontend_version}" != *v* ]]; then
|
||||||
WARN "前端最新版本号获取失败,继续启动..."
|
WARN "前端最新版本号获取失败,继续启动..."
|
||||||
return 1
|
return 1
|
||||||
@@ -289,21 +290,23 @@ if [[ "${MOVIEPILOT_AUTO_UPDATE}" = "true" ]] || [[ "${MOVIEPILOT_AUTO_UPDATE}"
|
|||||||
fi
|
fi
|
||||||
if [ "${MOVIEPILOT_AUTO_UPDATE}" = "dev" ]; then
|
if [ "${MOVIEPILOT_AUTO_UPDATE}" = "dev" ]; then
|
||||||
INFO "Dev 更新模式"
|
INFO "Dev 更新模式"
|
||||||
install_backend_and_download_resources "heads/main.zip"
|
install_backend_and_download_resources "heads/v2.zip"
|
||||||
else
|
else
|
||||||
INFO "Release 更新模式"
|
INFO "Release 更新模式"
|
||||||
old_version=$(grep -m -1 "^\s*APP_VERSION\s*=\s*" /app/version.py | tr -d '\r\n' | awk -F'#' '{print $1}' | sed 's/^[[:space:]]*//; s/[[:space:]]*$//')
|
old_version=$(grep -m -1 "^\s*APP_VERSION\s*=\s*" /app/version.py | tr -d '\r\n' | awk -F'#' '{print $1}' | sed 's/^[[:space:]]*//; s/[[:space:]]*$//')
|
||||||
if [[ "${old_version}" == *APP_VERSION* ]]; then
|
if [[ "${old_version}" == *APP_VERSION* ]]; then
|
||||||
current_version=$(echo "${old_version}" | sed -rn "s/APP_VERSION\s*=\s*['\"](.*)['\"]/\1/gp")
|
current_version=$(echo "${old_version}" | sed -rn "s/APP_VERSION\s*=\s*['\"](.*)['\"]/\1/gp")
|
||||||
INFO "当前版本号:${current_version}"
|
INFO "当前版本号:${current_version}"
|
||||||
new_version=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot/releases/latest" ${CURL_HEADERS} | jq -r .tag_name | tr -d '\r\n')
|
# 获取所有发布的版本列表,并筛选出以v2开头的版本号
|
||||||
if [[ "${new_version}" == *v* ]]; then
|
releases=$(curl ${CURL_OPTIONS} "https://api.github.com/repos/jxxghp/MoviePilot/releases" ${CURL_HEADERS} | jq -r '.[].tag_name' | grep "^v2\.")
|
||||||
release_version=${new_version}
|
if [ -z "$releases" ]; then
|
||||||
INFO "最新版本号:${release_version}"
|
WARN "未找到任何v2.x版本,继续启动..."
|
||||||
# 使用版本号比较函数进行比较
|
|
||||||
compare_versions "${current_version}" "${release_version}"
|
|
||||||
else
|
else
|
||||||
WARN "最新版本号获取失败,继续启动..."
|
# 找到最新的v2版本
|
||||||
|
latest_v2=$(echo "$releases" | sort -V | tail -n 1)
|
||||||
|
INFO "最新的v2.x版本号:${latest_v2}"
|
||||||
|
# 使用版本号比较函数进行比较,并下载最新版本
|
||||||
|
compare_versions "${current_version}" "${latest_v2}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
WARN "当前版本号获取失败,继续启动..."
|
WARN "当前版本号获取失败,继续启动..."
|
||||||
|
|||||||
+2
-1
@@ -1 +1,2 @@
|
|||||||
APP_VERSION = 'v2.0.0-alpha'
|
APP_VERSION = 'v2.0.0-beta'
|
||||||
|
FRONTEND_VERSION = 'v2.0.0-beta'
|
||||||
|
|||||||
Reference in New Issue
Block a user