fix:修复代码兼容性写法

This commit is contained in:
jxxghp
2025-03-23 12:10:21 +08:00
parent 79411a7350
commit 2f38b3040d
27 changed files with 242 additions and 145 deletions
+3 -1
View File
@@ -1,7 +1,9 @@
import shutil
from pathlib import Path
from typing import Union
import ruamel.yaml
from ruamel.yaml import CommentedMap
from app.core.config import settings
from app.log import logger
@@ -95,7 +97,7 @@ class CategoryHelper(metaclass=Singleton):
return self.get_category(self._tv_categorys, tmdb_info)
@staticmethod
def get_category(categorys: dict, tmdb_info: dict) -> str:
def get_category(categorys: Union[dict, CommentedMap], tmdb_info: dict) -> str:
"""
根据 TMDB信息与分类配置文件进行比较,确定所属分类
:param categorys: 分类配置