Skip to content

Commit

Permalink
Added Total Potential Unreg Torrents (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobokun committed Dec 24, 2021
1 parent 6ddf007 commit 41bb7f8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions modules/qbittorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ def rem_unregistered(self):
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)
Expand Down Expand Up @@ -376,6 +377,7 @@ def rem_unregistered(self):
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",
Expand Down Expand Up @@ -428,10 +430,10 @@ def rem_unregistered(self):
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):
Expand Down
1 change: 1 addition & 0 deletions modules/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def end_time_hooks(self, start_time, end_time, run_time, stats, body):
"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"],
Expand Down
5 changes: 4 additions & 1 deletion qbit_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def start():
"untagged":0,
"categorized": 0,
"rem_unreg": 0,
"pot_unreg": 0,
"taggednoHL": 0
}
try:
Expand All @@ -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()
Expand Down Expand Up @@ -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']}")
Expand Down

0 comments on commit 41bb7f8

Please sign in to comment.