mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-13 18:11:03 +08:00
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>
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
- 规则编辑器新增剧集偏移字段和「自动检测」按钮
|
||||
- 新增 i18n 翻译(中文/英文)
|
||||
- 优化规则编辑弹窗布局:统一表单字段对齐、统一按钮高度、修复移动端底部弹窗 z-index 层级问题
|
||||
- 修复下载器页面仅显示季度文件夹名的问题,现在会显示「番剧名 / Season 1」格式
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -16,9 +16,16 @@ export const useDownloaderStore = defineStore('downloader', () => {
|
||||
}
|
||||
|
||||
const result: TorrentGroup[] = [];
|
||||
// Regex to detect season-only folder names like "Season 1", "S01", "第1季", etc.
|
||||
const seasonOnlyRegex = /^(Season\s*\d+|S\d+|第\d+季)$/i;
|
||||
|
||||
for (const [savePath, items] of map) {
|
||||
const parts = savePath.replace(/\/$/, '').split('/');
|
||||
const name = parts[parts.length - 1] || savePath;
|
||||
const parts = savePath.replace(/\/$/, '').split('/').filter(Boolean);
|
||||
let name = parts[parts.length - 1] || savePath;
|
||||
// If the last part is just a season folder, include the parent folder too
|
||||
if (parts.length >= 2 && seasonOnlyRegex.test(name)) {
|
||||
name = `${parts[parts.length - 2]} / ${name}`;
|
||||
}
|
||||
const totalSize = items.reduce((sum, t) => sum + t.size, 0);
|
||||
const overallProgress =
|
||||
totalSize > 0
|
||||
@@ -65,7 +72,7 @@ export const useDownloaderStore = defineStore('downloader', () => {
|
||||
opts
|
||||
);
|
||||
const { execute: deleteSelected } = useApi(
|
||||
(deleteFiles: boolean = false) =>
|
||||
(deleteFiles = false) =>
|
||||
apiDownloader.deleteTorrents(selectedHashes.value, deleteFiles),
|
||||
opts
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user