Skip to content

Commit

Permalink
fix #646
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Sep 22, 2023
1 parent f173c21 commit b014c4a
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions app/plugins/torrentremover/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,20 +731,34 @@ def get_remove_torrents(self, downloader: str):
remove_torrents.append(item)
# 处理辅种
if self._samedata and remove_torrents:
remove_ids = [t.get("id") for t in remove_torrents]
remove_torrents_plus = []
for remove_torrent in remove_torrents:
name = remove_torrent.get("name")
size = remove_torrent.get("size")
for torrent in torrents:
if downloader == "qbittorrent":
item_plus = self.__get_qb_torrent(torrent)
plus_id = torrent.hash
plus_name = torrent.name
plus_size = torrent.size
plus_site = StringUtils.get_url_sld(torrent.tracker)
else:
item_plus = self.__get_tr_torrent(torrent)
if not item_plus:
continue
if item_plus.get("name") == name \
and item_plus.get("size") == size \
and item_plus.get("id") not in [t.get("id") for t in remove_torrents]:
remove_torrents_plus.append(item_plus)
remove_torrents.extend(remove_torrents_plus)
plus_id = torrent.hashString
plus_name = torrent.name
plus_size = torrent.total_size
plus_site = torrent.trackers[0].get("sitename") if torrent.trackers else ""
# 比对名称和大小
if plus_name == name \
and plus_size == size \
and plus_id not in remove_ids:
remove_torrents_plus.append(
{
"id": plus_id,
"name": plus_name,
"site": plus_site,
"size": plus_size
}
)
if remove_torrents_plus:
remove_torrents.extend(remove_torrents_plus)
return remove_torrents

0 comments on commit b014c4a

Please sign in to comment.