Added Total Potential Unreg Torrents (#68)

This commit is contained in:
bobokun 2021-12-24 09:50:47 -05:00
parent 6ddf0072d4
commit 41bb7f8b04
No known key found for this signature in database
GPG key ID: 9665BA6CF5DC2671
3 changed files with 10 additions and 4 deletions

View file

@ -331,6 +331,7 @@ class Qbt:
loglevel = 'DRYRUN' if dry_run else 'INFO'
del_tor = 0
del_tor_cont = 0
pot_unreg = 0
pot_unr_summary = ''
if self.config.args['rem_unregistered']:
separator(f"Removing Unregistered Torrents", space=False, border=False)
@ -376,6 +377,7 @@ class Qbt:
pot_unr += (util.insert_space(f'Tracker: {tags["url"]}',8)+'\n')
pot_unr += (util.insert_space(f"Added Tag: 'issue'",6)+'\n')
pot_unr_summary += pot_unr
pot_unreg += 1
attr = {
"function":"potential_rem_unregistered",
"title":"Potential Unregistered Torrents",
@ -428,10 +430,10 @@ class Qbt:
else:
print_line('No unregistered torrents found.',loglevel)
if (len(pot_unr_summary) > 0):
separator(f"Potential Unregistered torrents", space=False, border=False,loglevel=loglevel)
if (pot_unreg > 0):
separator(f"{pot_unreg} Potential Unregistered torrents found", space=False, border=False,loglevel=loglevel)
print_multiline(pot_unr_summary.rstrip(),loglevel)
return del_tor,del_tor_cont
return del_tor,del_tor_cont, pot_unreg
# Function used to move any torrents from the cross seed directory to the correct save directory
def cross_seed(self):

View file

@ -107,6 +107,7 @@ class Webhooks:
"torrents_categorized": stats["categorized"],
"torrents_tagged": stats["tagged"],
"remove_unregistered": stats["rem_unreg"],
"potential_unregistered": stats["pot_unreg"],
"orphaned_files_found": stats["orphaned"],
"torrents_tagged_no_hardlinks": stats["taggednoHL"],
"torrents_untagged_no_hardlinks": stats["untagged"],

View file

@ -164,6 +164,7 @@ def start():
"untagged":0,
"categorized": 0,
"rem_unreg": 0,
"pot_unreg": 0,
"taggednoHL": 0
}
try:
@ -182,10 +183,11 @@ def start():
stats["tagged"] += num_tagged
#Remove Unregistered Torrents
num_deleted,num_deleted_contents = cfg.qbt.rem_unregistered()
num_deleted,num_deleted_contents,num_pot_unreg = cfg.qbt.rem_unregistered()
stats["rem_unreg"] += (num_deleted + num_deleted_contents)
stats["deleted"] += num_deleted
stats["deleted_contents"] += num_deleted_contents
stats["pot_unreg"] += num_pot_unreg
#Set Cross Seed
num_added, num_tagged = cfg.qbt.cross_seed()
@ -216,6 +218,7 @@ def start():
if stats["categorized"] > 0: stats_summary.append(f"Total Torrents Categorized: {stats['categorized']}")
if stats["tagged"] > 0: stats_summary.append(f"Total Torrents Tagged: {stats['tagged']}")
if stats["rem_unreg"] > 0: stats_summary.append(f"Total Unregistered Torrents Removed: {stats['rem_unreg']}")
if stats["pot_unreg"] > 0: stats_summary.append(f"Total Potential Unregistered Torrents Found: {stats['pot_unreg']}")
if stats["added"] > 0: stats_summary.append(f"Total Torrents Added: {stats['added']}")
if stats["resumed"] > 0: stats_summary.append(f"Total Torrents Resumed: {stats['resumed']}")
if stats["rechecked"] > 0: stats_summary.append(f"Total Torrents Rechecked: {stats['rechecked']}")