feat(file): 支持8K视频文件处理
- 在分隔符常量中添加逗号支持 - 扩展文件重命名逻辑以支持8K标识符 - 更新种子文件处理以移除8K标记 - 添加8K文件名提取功能到种子服务
This commit is contained in:
+1
-1
@@ -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 = {"篠真有", "二羽紗愛", "綾瀬天"}
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user