From a18b835f2c326cf2fa4145a2df8bea105aaedd99 Mon Sep 17 00:00:00 2001 From: zhengshunjin <2667579369@qq.com> Date: Sat, 12 Sep 2026 19:47:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(file):=20=E6=94=AF=E6=8C=818K=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=96=87=E4=BB=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在分隔符常量中添加逗号支持 - 扩展文件重命名逻辑以支持8K标识符 - 更新种子文件处理以移除8K标记 - 添加8K文件名提取功能到种子服务 --- app/constants.py | 2 +- app/services/file_service.py | 2 +- app/services/torrent_service.py | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/constants.py b/app/constants.py index ed9ccb1..7675992 100644 --- a/app/constants.py +++ b/app/constants.py @@ -10,7 +10,7 @@ IGNORE_DIRS = { "女同" } SPECIAL_PREFIXES = {"T28", "FC2", "T38"} -SEPARATORS = {"♀  ", "♀ ", "+"} +SEPARATORS = {"♀  ", "♀ ", "+", ", "} SPECIAL_DIRS = {"川村まや", "上原亜衣", "上原志織"} IMAGE_EXTENSIONS = {'.jpg', '.jpeg', '.png', '.gif', '.bmp', '.tiff', '.webp', '.svg'} DISLIKE_DIRS = {"篠真有", "二羽紗愛", "綾瀬天"} diff --git a/app/services/file_service.py b/app/services/file_service.py index be069c6..6399c11 100644 --- a/app/services/file_service.py +++ b/app/services/file_service.py @@ -68,7 +68,7 @@ class FileService: else: new_name.append(char) - if ''.join(new_name[-2:]) == "4K": + if ''.join(new_name[-2:]) == "4K" or ''.join(new_name[-2:]) == "8K": new_name.insert(-2, "-") return self.perform_rename(entry, f"{''.join(new_name)}{ext}") diff --git a/app/services/torrent_service.py b/app/services/torrent_service.py index 68e88b8..25c2295 100644 --- a/app/services/torrent_service.py +++ b/app/services/torrent_service.py @@ -21,6 +21,7 @@ class TorrentService: def process_torrent_file(self, entry: os.DirEntry[str]) -> None: temp_name = entry.name.replace("-4K", "") + temp_name = entry.name.replace("-8K", "") without_modifier_file_name = self.prefix_pattern.sub('.', temp_name) name, ext = os.path.splitext(without_modifier_file_name) if name not in self.torrent_list: @@ -43,6 +44,7 @@ class TorrentService: def has_torrent_callback(self, entry: os.DirEntry): temp_name = entry.name temp_name = temp_name.replace("-4K", "") + temp_name = temp_name.replace("-8K", "") without_modifier_file_name = self.prefix_pattern.sub('.', temp_name) name, ext = os.path.splitext(without_modifier_file_name) if name not in self.torrent_list: @@ -124,6 +126,7 @@ class TorrentService: def extract_name_from_filename(self, filename: str) -> str: """根据torrent文件名提取标准化名称""" temp_name = filename.replace("-4K", "") + temp_name = filename.replace("-8K", "") without_modifier_file_name = self.prefix_pattern.sub('.', temp_name) name, ext = os.path.splitext(without_modifier_file_name) name = name.upper()