Skip to content

Commit

Permalink
fix: bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuan0213 committed Apr 6, 2023
2 parents 0117ee6 + 39e6299 commit 9b511e2
Show file tree
Hide file tree
Showing 95 changed files with 4,040 additions and 1,093 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- .github/workflows/build-dev.yml
- package_list.txt
- requirements.txt
- docker/Dockerfile.dev
- docker/dev.Dockerfile
- docker/entrypoint.sh
jobs:
build:
Expand Down Expand Up @@ -46,10 +46,10 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile.dev
file: docker/dev.Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/nas-tools:${{ env.app_version }}-beta
${{ secrets.DOCKER_USERNAME }}/nas-tools:latest-beta
96 changes: 87 additions & 9 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
name: windows
path: D:/a/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.exe

Linux-build:
Linux-build-amd64:
runs-on: ubuntu-latest
steps:
- name: init Python 3.10.10
Expand Down Expand Up @@ -84,14 +84,89 @@ jobs:
pwd
ls -all
pyinstaller nas-tools.spec
mv /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.linux
mv /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.linux.amd64
ls -all /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist
shell: pwsh
- name: upload linux file
uses: actions/upload-artifact@v3
with:
name: linux
path: /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.linux
name: linux-amd64
path: /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.linux.amd64

Linux-build-arm64:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@master
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set Up Buildx
uses: docker/setup-buildx-action@v1
- name: package through pyinstaller
run: |
mkdir rootfs
docker buildx build --platform linux/arm64 --file ./package/builder/Dockerfile --build-arg branch=master --output type=local,dest=./rootfs .
mkdir -p /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/
cp ./rootfs/nas-tools /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.linux.arm64
shell: pwsh
- name: upload linux file
uses: actions/upload-artifact@v3
with:
name: linux-arm64
path: /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.linux.arm64

Linux-build-amd64-musl:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@master
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set Up Buildx
uses: docker/setup-buildx-action@v1
- name: package through pyinstaller
run: |
mkdir rootfs
docker buildx build --platform linux/amd64 --file ./package/builder/alpine.Dockerfile --build-arg branch=master --output type=local,dest=./rootfs .
mkdir -p /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/
cp ./rootfs/nas-tools /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.linux.musl.amd64
shell: pwsh
- name: upload linux file
uses: actions/upload-artifact@v3
with:
name: linux-musl-amd64
path: /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.linux.musl.amd64

Linux-build-arm64-musl:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@master
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set Up Buildx
uses: docker/setup-buildx-action@v1
- name: package through pyinstaller
run: |
mkdir rootfs
docker buildx build --platform linux/arm64 --file ./package/builder/alpine.Dockerfile --build-arg branch=master --output type=local,dest=./rootfs .
mkdir -p /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/
cp ./rootfs/nas-tools /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.linux.musl.arm64
shell: pwsh
- name: upload linux file
uses: actions/upload-artifact@v3
with:
name: linux-musl-arm64
path: /home/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.linux.musl.arm64

Mac-build:
runs-on: macos-latest
Expand Down Expand Up @@ -126,20 +201,20 @@ jobs:
cp -r ./db_scripts/. $Python_ROOT_DIR/lib/python3.10/site-packages/db_scripts/
cd package
pyinstaller nas-tools.spec
mv ./dist/nas-tools ./dist/nas-tools.mac
mv ./dist/nas-tools ./dist/nas-tools.macos
pwd
ls -all ./dist/
shell: bash
- name: upload mac file
uses: actions/upload-artifact@v3
with:
name: macos
path: /Users/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.mac
path: /Users/runner/work/nas-tools/nas-tools/nas-tools/package/dist/nas-tools.macos

Create-release_Send-message:
permissions: write-all
runs-on: ubuntu-latest
needs: [Windows-build, Linux-build, Mac-build]
needs: [Windows-build, Linux-build-amd64, Linux-build-arm64, Linux-build-amd64-musl, Linux-build-arm64-musl, Mac-build]
steps:
- uses: actions/checkout@v2
- name: Release version
Expand All @@ -156,8 +231,11 @@ jobs:
ls -all
mkdir releases
mv ./windows/nas-tools.exe /home/runner/work/nas-tools/nas-tools/releases/nastool_win_v${{ env.app_version }}.exe
mv ./linux/nas-tools.linux /home/runner/work/nas-tools/nas-tools/releases/nastool_linux_v${{ env.app_version }}
mv ./macos/nas-tools.mac /home/runner/work/nas-tools/nas-tools/releases/nastool_macos_v${{ env.app_version }}
mv ./linux-amd64/nas-tools.linux.amd64 /home/runner/work/nas-tools/nas-tools/releases/nastool_linux_amd64_v${{ env.app_version }}
mv ./linux-arm64/nas-tools.linux.arm64 /home/runner/work/nas-tools/nas-tools/releases/nastool_linux_arm64_v${{ env.app_version }}
mv ./linux-musl-amd64/nas-tools.linux.musl.amd64 /home/runner/work/nas-tools/nas-tools/releases/nastool_linux_musl_amd64_v${{ env.app_version }}
mv ./linux-musl-arm64/nas-tools.linux.musl.arm64 /home/runner/work/nas-tools/nas-tools/releases/nastool_linux_musl_arm64_v${{ env.app_version }}
mv ./macos/nas-tools.macos /home/runner/work/nas-tools/nas-tools/releases/nastool_macos_v${{ env.app_version }}
pwd
ls -all
- name: Create release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ jobs:
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/nas-tools:latest
${{ secrets.DOCKER_USERNAME }}/nas-tools:${{ env.app_version }}
${{ secrets.DOCKER_USERNAME }}/nas-tools:${{ env.app_version }}
6 changes: 3 additions & 3 deletions app/brushtask.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def __send_message(_task_name, _delete_type, _torrent_name):
set(torrent_ids).difference(
set([(torrent.get("hash")
if downloader_type == 'qbittorrent'
else str(torrent.id)) for torrent in torrents])))
else str(torrent.hashString)) for torrent in torrents])))
# 完成的种子
for torrent in torrents:
torrent_info = self.__get_torrent_dict(downloader_type=downloader_type,
Expand Down Expand Up @@ -345,7 +345,7 @@ def __send_message(_task_name, _delete_type, _torrent_name):
set(remove_torrent_ids).difference(
set([(torrent.get("hash")
if downloader_type == 'qbittorrent'
else str(torrent.id)) for torrent in torrents])))
else str(torrent.hashString)) for torrent in torrents])))
# 下载中的种子
for torrent in torrents:
torrent_info = self.__get_torrent_dict(downloader_type=downloader_type,
Expand Down Expand Up @@ -741,7 +741,7 @@ def __get_torrent_dict(downloader_type, torrent):
total_size = torrent.get("total_size")
else:
# ID
torrent_id = torrent.id
torrent_id = torrent.hashString
# 做种时间
date_done = torrent.date_done or torrent.date_added
# 下载耗时
Expand Down
2 changes: 1 addition & 1 deletion app/conf/systemconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def set_system_config(self, key: [SystemConfigKey, str], value):
self.systemconfig[key] = value
# 写入数据库
if self.__is_obj(value):
if value:
if value is not None:
value = json.dumps(value)
else:
value = ''
Expand Down
4 changes: 4 additions & 0 deletions app/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ class RSSMOVIES(Base):
FILTER_PIX = Column(Text)
FILTER_RULE = Column(Integer)
FILTER_TEAM = Column(Text)
FILTER_INCLUDE = Column(Text)
FILTER_EXCLUDE = Column(Text)
SAVE_PATH = Column(Text)
DOWNLOAD_SETTING = Column(Integer)
FUZZY_MATCH = Column(Integer)
Expand Down Expand Up @@ -302,6 +304,8 @@ class RSSTVS(Base):
FILTER_PIX = Column(Text)
FILTER_RULE = Column(Integer)
FILTER_TEAM = Column(Text)
FILTER_INCLUDE = Column(Text)
FILTER_EXCLUDE = Column(Text)
SAVE_PATH = Column(Text)
DOWNLOAD_SETTING = Column(Integer)
FUZZY_MATCH = Column(Integer)
Expand Down
Loading

0 comments on commit 9b511e2

Please sign in to comment.