From 31aee16b1cc28ccc62cc0014b8136c62472f89d2 Mon Sep 17 00:00:00 2001 From: garypiner Date: Thu, 5 Jan 2023 17:04:39 +0000 Subject: [PATCH 1/2] NoHL torrents been removed when criteria not met --- modules/qbittorrent.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/qbittorrent.py b/modules/qbittorrent.py index 18c81f4..7f37acc 100755 --- a/modules/qbittorrent.py +++ b/modules/qbittorrent.py @@ -548,12 +548,12 @@ class Qbt: tracker["url"], ) if tor_reach_seed_limit: - if torrent.name not in tdel_dict: - tdel_dict[torrent.name] = {} - tdel_dict[torrent.name]["content_path"] = torrent["content_path"].replace( + if torrent.hash not in tdel_dict: + tdel_dict[torrent.hash] = {} + tdel_dict[torrent.hash]["content_path"] = torrent["content_path"].replace( root_dir, remote_dir ) - tdel_dict[torrent.name]["body"] = tor_reach_seed_limit + tdel_dict[torrent.hash]["body"] = tor_reach_seed_limit else: # Updates torrent to see if "MinSeedTimeNotReached" tag has been added torrent = self.get_torrents({"torrent_hashes": [torrent.hash]}).data[0] @@ -608,19 +608,20 @@ class Qbt: torrent_list = self.get_torrents({"category": category, "status_filter": "completed"}) for torrent in torrent_list: t_name = torrent.name - if t_name in tdel_dict.keys() and "noHL" in torrent.tags: + t_hash = torrent.hash + if t_hash in tdel_dict.keys() and "noHL" in torrent.tags: t_count = self.torrentinfo[t_name]["count"] t_msg = self.torrentinfo[t_name]["msg"] t_status = self.torrentinfo[t_name]["status"] # Double check that the content path is the same before we delete anything - if torrent["content_path"].replace(root_dir, remote_dir) == tdel_dict[t_name]["content_path"]: + if torrent["content_path"].replace(root_dir, remote_dir) == tdel_dict[t_hash]["content_path"]: tracker = self.config.get_tags(torrent.trackers) body = [] body += logger.print_line(logger.insert_space(f"Torrent Name: {t_name}", 3), self.config.loglevel) body += logger.print_line( logger.insert_space(f'Tracker: {tracker["url"]}', 8), self.config.loglevel ) - body += logger.print_line(tdel_dict[t_name]["body"], self.config.loglevel) + body += logger.print_line(tdel_dict[t_hash]["body"], self.config.loglevel) body += logger.print_line( logger.insert_space("Cleanup: True [No hard links found and meets Share Limits.]", 8), self.config.loglevel, From 85711d93e99561f0dafa09f8ebfe794d81c90b19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Feb 2023 00:31:18 +0000 Subject: [PATCH 2/2] Bump pre-commit from 3.0.4 to 3.1.0 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.0.4 to 3.1.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.0.4...v3.1.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0d92fca..45b0b50 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ flake8==6.0.0 -pre-commit==3.0.4 +pre-commit==3.1.0 qbittorrent-api==2023.2.42 requests==2.28.2 retrying==1.3.4