fix
This commit is contained in:
parent
bd4c639761
commit
e6af2c0f34
@ -146,15 +146,15 @@ class AutoClean(_PluginBase):
|
||||
history = self.get_data('history') or []
|
||||
|
||||
# 创建一个字典来保存分组结果
|
||||
downloadhis_grouped_dict = defaultdict(list)
|
||||
downloadhis_grouped_dict: Dict[tuple, List[DownloadHistory]] = defaultdict(list)
|
||||
# 遍历DownloadHistory对象列表
|
||||
for downloadhis in downloadhis_list:
|
||||
# 获取type和tmdbid的值
|
||||
type = downloadhis.type
|
||||
dtype = downloadhis.type
|
||||
tmdbid = downloadhis.tmdbid
|
||||
|
||||
# 将DownloadHistory对象添加到对应分组的列表中
|
||||
downloadhis_grouped_dict[(type, tmdbid)].append(downloadhis)
|
||||
downloadhis_grouped_dict[(dtype, tmdbid)].append(downloadhis)
|
||||
|
||||
# 输出分组结果
|
||||
for key, downloadhis_list in downloadhis_grouped_dict.items():
|
||||
|
@ -158,15 +158,16 @@ class NAStoolSync(_PluginBase):
|
||||
|
||||
# 替换value
|
||||
if isinstance(plugin_value, str):
|
||||
plugin_value = json.loads(plugin_value)
|
||||
if str(plugin_value.get("to_download")).isdigit() and int(
|
||||
plugin_value.get("to_download")) == int(sub_downloaders[0]):
|
||||
plugin_value["to_download"] = sub_downloaders[1]
|
||||
_value: dict = json.loads(plugin_value)
|
||||
elif isinstance(plugin_value, dict):
|
||||
if str(plugin_value.get("to_download")).isdigit() and int(
|
||||
plugin_value.get("to_download")) == int(sub_downloaders[0]):
|
||||
plugin_value["to_download"] = sub_downloaders[1]
|
||||
|
||||
# 替换辅种记录
|
||||
if str(plugin_id) == "IYUUAutoSeed":
|
||||
if isinstance(plugin_value, str):
|
||||
plugin_value = json.loads(plugin_value)
|
||||
plugin_value: list = json.loads(plugin_value)
|
||||
if not isinstance(plugin_value, list):
|
||||
plugin_value = [plugin_value]
|
||||
for value in plugin_value:
|
||||
|
@ -36,6 +36,12 @@ class DownloadHistory(BaseModel):
|
||||
torrent_description: Optional[str] = None
|
||||
# 站点
|
||||
torrent_site: Optional[str] = None
|
||||
# 下载用户
|
||||
userid: Optional[str] = None
|
||||
# 下载渠道
|
||||
channel: Optional[str] = None
|
||||
# 创建时间
|
||||
date: Optional[str] = None
|
||||
# 备注
|
||||
note: Optional[str] = None
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user