Skip to content

Commit 0f2323c

Browse files
authored
Merge branch 'main' into aio_beta
2 parents 41d027a + 7913061 commit 0f2323c

14 files changed

Lines changed: 147 additions & 41 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ body:
66
- type: markdown
77
attributes:
88
value: |
9-
描述问题前,请先更新到最新版本。2.5 之前的版本升级请参考 [升级指南](https://www.autobangumi.org/changelog/2.6.html#如何从老版本更新的注意事项)
10-
请确认以下信息,如果你的问题可以直接在文档中找到,那么你的 issue 将会被直接关闭。
9+
描述问题前,请先更新到最新版本。
10+
请确认以下信息,如果你没有完成以下检查,那么你的 issue 将会被直接关闭。
1111
解析器问题请转到[专用模板](https://github.com/EstrellaXD/Auto_Bangumi/issues/new?assignees=&labels=bug&template=parser_bug.yml&title=%5B解析器错误%5D),
1212
重命名问题请到[专用模板](https://github.com/EstrellaXD/Auto_Bangumi/issues/new?assignees=&labels=bug&template=rename_bug.yml&title=%5B重命名错误%5D)
1313
- type: checkboxes
@@ -18,13 +18,11 @@ body:
1818
options:
1919
- label: 我的版本是最新版本,我的版本号与 [version](https://github.com/EstrellaXD/Auto_Bangumi/releases/latest) 相同。
2020
required: true
21-
- label: 我已经查阅了[排错流程](https://autobangumi.org/faq/排错流程.html),确保提出的问题不在其中。
22-
required: true
23-
- label: 我已经查阅了[已知问题](https://autobangumi.org/faq/常见问题.html),并确认我的问题不在其中。
21+
- label: 我已经查阅了[已知问题](https://autobangumi.org/faq/),并确认我的问题不在其中。
2422
required: true
2523
- label: 我已经 [issue](https://github.com/EstrellaXD/Auto_Bangumi/issues) 中搜索过,确认我的问题没有被提出过。
2624
required: true
27-
- label: 我已经修改标题,将标题中的 描述 替换为我遇到的问题。
25+
- label: 我已经修改标题,将标题中的 **描述** 替换为我遇到的问题。
2826
required: true
2927
- type: input
3028
id: version

.github/workflows/build.yml

Lines changed: 69 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
test:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- name: Set up Python 3.11
1717
uses: actions/setup-python@v3
1818
with:
@@ -28,11 +28,48 @@ jobs:
2828
mkdir -p config
2929
pytest
3030
31+
webui-test:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Install Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 20
41+
42+
- uses: pnpm/action-setup@v4
43+
name: Install pnpm
44+
with:
45+
version: 9
46+
run_install: false
47+
48+
- name: Get pnpm store directory
49+
shell: bash
50+
run: |
51+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
52+
53+
- uses: actions/cache@v4
54+
name: Setup pnpm cache
55+
with:
56+
path: ${{ env.STORE_PATH }}
57+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
58+
restore-keys: |
59+
${{ runner.os }}-pnpm-store-
60+
61+
- name: Install dependencies
62+
run: cd webui && pnpm install
63+
64+
- name: build test
65+
run: |
66+
cd webui && pnpm test:build
67+
3168
version-info:
3269
runs-on: ubuntu-latest
3370
steps:
3471
- name: Checkout
35-
uses: actions/checkout@v3
72+
uses: actions/checkout@v4
3673
- name: If release
3774
id: release
3875
run: |
@@ -79,25 +116,35 @@ jobs:
79116

80117
build-webui:
81118
runs-on: ubuntu-latest
82-
needs: [ test, version-info ]
119+
needs: [test, webui-test, version-info]
83120
if: ${{ needs.version-info.outputs.release == 1 || needs.version-info.outputs.dev == 1 }}
84-
strategy:
85-
matrix:
86-
node-version: [ 18 ]
87121
steps:
88122
- name: Checkout
89-
uses: actions/checkout@v3
123+
uses: actions/checkout@v4
124+
125+
- name: Install Node.js
126+
uses: actions/setup-node@v4
127+
with:
128+
node-version: 20
90129

91-
- uses: pnpm/action-setup@v2
130+
- uses: pnpm/action-setup@v4
131+
name: Install pnpm
92132
with:
93-
version: 8
133+
version: 9
134+
run_install: false
135+
136+
- name: Get pnpm store directory
137+
shell: bash
138+
run: |
139+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
94140
95-
- name: Use Node.js ${{ matrix.node-version }}
96-
uses: actions/setup-node@v3
141+
- uses: actions/cache@v4
142+
name: Setup pnpm cache
97143
with:
98-
node-version: ${{ matrix.node-version }}
99-
cache: 'pnpm'
100-
cache-dependency-path: webui/pnpm-lock.yaml
144+
path: ${{ env.STORE_PATH }}
145+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
146+
restore-keys: |
147+
${{ runner.os }}-pnpm-store-
101148
102149
- name: Install dependencies
103150
run: cd webui && pnpm install
@@ -114,10 +161,10 @@ jobs:
114161

115162
build-docker:
116163
runs-on: ubuntu-latest
117-
needs: [ build-webui, version-info ]
164+
needs: [build-webui, version-info]
118165
steps:
119166
- name: Checkout
120-
uses: actions/checkout@v3
167+
uses: actions/checkout@v4
121168

122169
- name: Create Version info via tag
123170
working-directory: ./backend/src
@@ -217,14 +264,14 @@ jobs:
217264

218265
release:
219266
runs-on: ubuntu-latest
220-
needs: [ build-docker, version-info ]
267+
needs: [build-docker, version-info]
221268
if: ${{ needs.version-info.outputs.release == 1 }}
222269
outputs:
223270
url: ${{ steps.release.outputs.url }}
224271
version: ${{ needs.version-info.outputs.version }}
225272
steps:
226273
- name: Checkout code
227-
uses: actions/checkout@v3
274+
uses: actions/checkout@v4
228275

229276
- name: Download artifact webui
230277
uses: actions/download-artifact@v3
@@ -247,11 +294,10 @@ jobs:
247294
run: |
248295
echo ${{ needs.version-info.outputs.version }}
249296
echo "VERSION='${{ needs.version-info.outputs.version }}'" >> module/__version__.py
250-
297+
251298
- name: Copy requirements.txt
252299
working-directory: ./backend
253-
run:
254-
cp requirements.txt src/requirements.txt
300+
run: cp requirements.txt src/requirements.txt
255301

256302
- name: Zip app
257303
run: |
@@ -267,7 +313,7 @@ jobs:
267313
echo "version=🌟${{ needs.version-info.outputs.version }}" >> $GITHUB_OUTPUT
268314
echo "pre_release=false" >> $GITHUB_OUTPUT
269315
fi
270-
316+
271317
- name: Release
272318
id: release
273319
uses: softprops/action-gh-release@v1
@@ -283,10 +329,9 @@ jobs:
283329
env:
284330
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
285331

286-
287332
telegram:
288333
runs-on: ubuntu-latest
289-
needs: [ release ]
334+
needs: [release]
290335
steps:
291336
- name: send telegram message on push
292337
uses: appleboy/telegram-action@master

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,3 @@ dev-dist
216216

217217
# test file
218218
test.*
219-
test_*

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</p>
1111

1212
<p align="center">
13-
<a href="https://www.autobangumi.org">官方网站</a> | <a href="https://www.autobangumi.org/deploy/quick-start.html">快速开始</a> | <a href="https://www.autobangumi.org/changelog/3.0.html">更新日志</a> | <a href="https://t.me/autobangumi">TG 群组</a>
13+
<a href="https://www.autobangumi.org">官方网站</a> | <a href="https://www.autobangumi.org/deploy/quick-start.html">快速开始</a> | <a href="https://www.autobangumi.org/changelog/3.0.html">更新日志</a> | <a href="https://t.me/autobangumi_update">更新推送</a> | <a href="https://t.me/autobangumi">TG 群组</a>
1414
</p>
1515

1616
# 项目说明
@@ -60,11 +60,6 @@
6060
- 无需维护完全无感使用
6161
- 内置 TDMB 解析器,可以直接生成完整的 TMDB 格式的文件以及番剧信息。
6262

63-
## 相关群组
64-
65-
- 更新推送:[Telegram Channel](https://t.me/autobangumi_update)
66-
- Bug 反馈群:[Telegram](https://t.me/+yNisOnDGaX5jMTM9)
67-
6863
## [Roadmap](https://github.com/users/EstrellaXD/projects/2)
6964

7065

backend/src/module/api/rss.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ async def download_collection(data: Bangumi):
258258
dependencies=[Depends(get_current_user)],
259259
)
260260
async def subscribe(data: Bangumi, rss: RSSItem):
261+
261262
resp = await collector.subscribe_season(data, parser=rss.parser)
262263

263264
if resp:
@@ -276,3 +277,4 @@ async def subscribe(data: Bangumi, rss: RSSItem):
276277
msg_zh=f"[Engine] 下载 {data.official_title} 失败。",
277278
)
278279
return u_response(resp)
280+

backend/src/module/database/user.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ def get_user(self, username):
2424
def auth_user(self, user: User):
2525
statement = select(User).where(User.username == user.username)
2626
result = self.session.exec(statement).first()
27+
if not user.password:
28+
return ResponseModel(
29+
status_code=401, status=False, msg_en="Incorrect password format", msg_zh="密码格式不正确"
30+
)
2731
if not result:
2832
return ResponseModel(
2933
status_code=401, status=False, msg_en="User not found", msg_zh="用户不存在"

backend/src/module/manager/collector.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ async def collect_season(self, bangumi: Bangumi, link: str = None):
4141
return False
4242

4343
@staticmethod
44+
4445
async def subscribe_season(data: Bangumi,parser:str = "mikan"):
4546
data.added = True
4647
data.eps_collect = True

backend/src/module/models/config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from os.path import expandvars
22
from typing import Literal
33

4-
from pydantic import BaseModel, Field
4+
from pydantic import BaseModel, Field, validator
55

66

77
class Program(BaseModel):
@@ -122,6 +122,12 @@ class ExperimentalOpenAI(BaseModel):
122122
"", description="Azure OpenAI deployment id, ignored when api type is openai"
123123
)
124124

125+
@validator("api_base")
126+
def validate_api_base(cls, value: str):
127+
if value == "https://api.openai.com/":
128+
return "https://api.openai.com/v1"
129+
return value
130+
125131

126132
class Config(BaseModel):
127133
program: Program = Program()

backend/src/module/parser/analyser/mikan_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,4 @@ async def poster_parser(self):
8787
parser = MikanParser(url)
8888

8989
print(asyncio.run(parser.poster_parser()))
90+

backend/src/module/parser/analyser/raw_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
"V": 5,
148148
}
149149

150+
150151
UNUSEFUL_RE = re.compile(
151152
r"""
152153
# 匹配无用的片段

0 commit comments

Comments
 (0)