Skip to content

Commit 9ae643e

Browse files
EstrellaXDclaude
andcommitted
fix(ui): show anime name with season in downloader page
When save_path ends with a season-only folder (Season 1, S01, 第1季), display "Anime Name / Season 1" instead of just "Season 1" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c972417 commit 9ae643e

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
- 规则编辑器新增剧集偏移字段和「自动检测」按钮
3737
- 新增 i18n 翻译(中文/英文)
3838
- 优化规则编辑弹窗布局:统一表单字段对齐、统一按钮高度、修复移动端底部弹窗 z-index 层级问题
39+
- 修复下载器页面仅显示季度文件夹名的问题,现在会显示「番剧名 / Season 1」格式
3940

4041
---
4142

webui/src/store/downloader.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@ export const useDownloaderStore = defineStore('downloader', () => {
1616
}
1717

1818
const result: TorrentGroup[] = [];
19+
// Regex to detect season-only folder names like "Season 1", "S01", "第1季", etc.
20+
const seasonOnlyRegex = /^(Season\s*\d+|S\d+|\d+)$/i;
21+
1922
for (const [savePath, items] of map) {
20-
const parts = savePath.replace(/\/$/, '').split('/');
21-
const name = parts[parts.length - 1] || savePath;
23+
const parts = savePath.replace(/\/$/, '').split('/').filter(Boolean);
24+
let name = parts[parts.length - 1] || savePath;
25+
// If the last part is just a season folder, include the parent folder too
26+
if (parts.length >= 2 && seasonOnlyRegex.test(name)) {
27+
name = `${parts[parts.length - 2]} / ${name}`;
28+
}
2229
const totalSize = items.reduce((sum, t) => sum + t.size, 0);
2330
const overallProgress =
2431
totalSize > 0
@@ -65,7 +72,7 @@ export const useDownloaderStore = defineStore('downloader', () => {
6572
opts
6673
);
6774
const { execute: deleteSelected } = useApi(
68-
(deleteFiles: boolean = false) =>
75+
(deleteFiles = false) =>
6976
apiDownloader.deleteTorrents(selectedHashes.value, deleteFiles),
7077
opts
7178
);

0 commit comments

Comments
 (0)