From 26ac36a164f362771c9cd363e8ab610e5b3332cf Mon Sep 17 00:00:00 2001 From: jblu Date: Mon, 25 Jul 2022 12:36:15 -0500 Subject: [PATCH] fixed attrubute error --- qbit-maid.py | 1 + qlogging.py | 28 +++++++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/qbit-maid.py b/qbit-maid.py index beb4fc5..b2ba598 100644 --- a/qbit-maid.py +++ b/qbit-maid.py @@ -69,6 +69,7 @@ class Qbt: listqbitapiinfo(self) listfirsttor(self) buildtorlist(self) + processcounts(self) #tordeletetags(self) if self.use_log: torrentcount(self) diff --git a/qlogging.py b/qlogging.py index 72380b9..4a1f6dd 100644 --- a/qlogging.py +++ b/qlogging.py @@ -16,6 +16,21 @@ def tornotifytest(self): """Used to make sure tornotify is working and messages are getting to the client""" self.poc.send_message("Test Message", title="qbit-maid") +def processcounts(self): + self.c = self.ct() + for item in self.tracker_list: + self.c[item["tags"]] += 1 + +def printprocessor(self): + """Print summary of torrents""" + self.tl.info(f'Total: {self.total_torrents}') + self.tl.info(f'Premature: {self.preme_tor_counter}') + self.tl.info(f'Ignored: {self.ignored_counter}') + self.tl.info(f'Protected: {self.c[self.tracker_protected_tag]}') + self.tl.info(f'Non-protected: {self.c[self.tracker_non_protected_tag]}') + self.tl.info(f'Orphaned: {self.up_tor_counter}') + self.tl.info(f'Marked for deletion: {len(self.torrent_hash_delete_list)}') + def tornotifysummary(self): """Main notification method when the app is used in an automated fashion""" self.poc.send_message(f" Total: {self.total_torrents}\n\ @@ -26,19 +41,6 @@ def tornotifysummary(self): Orphaned: {self.up_tor_counter}\n\ Marked for deletion: {len(self.torrent_hash_delete_list)}", title="--- qbit-maid summary ---") -def printprocessor(self): - """Print summary of torrents""" - self.c = self.ct() - for item in self.tracker_list: - self.c[item["tags"]] += 1 - self.tl.info(f'Total: {self.total_torrents}') - self.tl.info(f'Premature: {self.preme_tor_counter}') - self.tl.info(f'Ignored: {self.ignored_counter}') - self.tl.info(f'Protected: {self.c[self.tracker_protected_tag]}') - self.tl.info(f'Non-protected: {self.c[self.tracker_non_protected_tag]}') - self.tl.info(f'Orphaned: {self.up_tor_counter}') - self.tl.info(f'Marked for deletion: {len(self.torrent_hash_delete_list)}') - def getunixtimestamp(self): """Used for debuging and development related to unixtimestamps, not used in main script but useful""" self.uts = self.t.time()