From 300d6c2da0b5b3842a4c3ea730ed4a94bbb26d0c Mon Sep 17 00:00:00 2001 From: thsrite Date: Sun, 20 Aug 2023 16:08:59 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=A1=A5=E5=85=85=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E5=8E=86=E5=8F=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/nastoolsync/__init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/plugins/nastoolsync/__init__.py b/app/plugins/nastoolsync/__init__.py index 4da3548b..9e7f99e1 100644 --- a/app/plugins/nastoolsync/__init__.py +++ b/app/plugins/nastoolsync/__init__.py @@ -296,6 +296,7 @@ class NAStoolSync(_PluginBase): if str(torrent.get("name")) == str(torrent_name) \ or str(torrent.get("name")) == str(torrent_name2): mdownload_hash = torrent.get("hash") + torrent_name = str(torrent.get("name")) break # 处理辅种器 @@ -304,6 +305,7 @@ class NAStoolSync(_PluginBase): if str(torrent.get("name")) == str(torrent_name) \ or str(torrent.get("name")) == str(torrent_name2): mdownload_hash = torrent.get("hashString") + torrent_name = str(torrent.get("name")) break # 继续补充 遍历所有种子,按照添加升序升序,第一个种子是初始种子 @@ -320,6 +322,7 @@ class NAStoolSync(_PluginBase): mate_torrents = sorted(mate_torrents, key=lambda x: x.added_date) # 最早添加的hash是下载的hash mdownload_hash = mate_torrents[0].get("hashString") + torrent_name = str(mate_torrents[0].get("name")) # 补充转种记录 self._plugindata.save(plugin_id="TorrentTransfer", key=f"qbittorrent-{mdownload_hash}", @@ -337,6 +340,22 @@ class NAStoolSync(_PluginBase): mate_torrents[1:]]}] ) + # 补充下载历史 + self._downloadhistory.add( + path=msrc_filename, + type=mtype, + title=mtitle, + year=myear, + tmdbid=mtmdbid, + seasons=mseasons, + episodes=mepisodes, + image=mimage, + download_hash=mdownload_hash, + torrent_name=torrent_name, + torrent_description="", + torrent_site="" + ) + # 处理路径映射 if self._path: paths = self._path.split("\n")