mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-10-30 16:08:26 +08:00
update better logging for deleting noHL tags
This commit is contained in:
parent
63d5f6abde
commit
5b8b47a797
1 changed files with 24 additions and 18 deletions
|
|
@ -489,6 +489,7 @@ def tag_nohardlinks():
|
||||||
t_count = 0 #counter for the number of torrents that has no hard links
|
t_count = 0 #counter for the number of torrents that has no hard links
|
||||||
t_del = 0 #counter for the number of torrents that has no hard links and meets the criteria for ratio limit/seed limit for deletion
|
t_del = 0 #counter for the number of torrents that has no hard links and meets the criteria for ratio limit/seed limit for deletion
|
||||||
t_del_cs = 0 #counter for the number of torrents that has no hard links and meets the criteria for ratio limit/seed limit for deletion including cross-seeds
|
t_del_cs = 0 #counter for the number of torrents that has no hard links and meets the criteria for ratio limit/seed limit for deletion including cross-seeds
|
||||||
|
tdel_tags = 0 #counter for number of torrents that previously had no hard links but now have hard links
|
||||||
n_info = ''
|
n_info = ''
|
||||||
tdel_dict = {} #dictionary to track the torrent names and content path that meet the deletion criteria
|
tdel_dict = {} #dictionary to track the torrent names and content path that meet the deletion criteria
|
||||||
t_excl_tags = []#list of tags to exclude based on config.yml
|
t_excl_tags = []#list of tags to exclude based on config.yml
|
||||||
|
|
@ -557,6 +558,7 @@ def tag_nohardlinks():
|
||||||
n_info += (f'\n - Previous Tagged noHL Torrent Name: {torrent.name} has hard links found now.')
|
n_info += (f'\n - Previous Tagged noHL Torrent Name: {torrent.name} has hard links found now.')
|
||||||
n_info += (' Removing tags noHL.')
|
n_info += (' Removing tags noHL.')
|
||||||
n_info += (' Removing ratio and seeding time limits.')
|
n_info += (' Removing ratio and seeding time limits.')
|
||||||
|
tdel_tags += 1
|
||||||
if args.dry_run != 'dry_run':
|
if args.dry_run != 'dry_run':
|
||||||
#Remove tags and share limits
|
#Remove tags and share limits
|
||||||
torrent.remove_tags(tags='noHL')
|
torrent.remove_tags(tags='noHL')
|
||||||
|
|
@ -576,25 +578,29 @@ def tag_nohardlinks():
|
||||||
else:
|
else:
|
||||||
torrent.delete(hash=torrent.hash, delete_files=False)
|
torrent.delete(hash=torrent.hash, delete_files=False)
|
||||||
|
|
||||||
if args.dry_run == 'dry_run':
|
if args.dry_run == 'dry_run':
|
||||||
if t_count >= 1 or len(n_info) > 1:
|
if t_count >= 1 or len(n_info) > 1:
|
||||||
logger.dryrun(n_info)
|
logger.dryrun(n_info)
|
||||||
logger.dryrun(f'Did not tag/set ratio limit/seeding time for {t_count} .torrents(s)')
|
logger.dryrun(f'Did not tag/set ratio limit/seeding time for {t_count} .torrents(s)')
|
||||||
if t_del >= 1:
|
if t_del >= 1:
|
||||||
logger.dryrun(f'Did not delete {t_del} .torrents(s) or content files.')
|
logger.dryrun(f'Did not delete {t_del} .torrents(s) or content files.')
|
||||||
logger.dryrun(f'Did not delete {t_del_cs} .torrents(s) (including cross-seed) or content files.')
|
logger.dryrun(f'Did not delete {t_del_cs} .torrents(s) (including cross-seed) or content files.')
|
||||||
else:
|
if tdel_tags >= 1:
|
||||||
logger.dryrun('No torrents to tag with no hard links.')
|
logger.dryrun(f'Did not delete noHL tags/unset ratio limit/seeding time for {tdel_tags} .torrents(s)')
|
||||||
else:
|
else:
|
||||||
|
logger.dryrun('No torrents to tag with no hard links.')
|
||||||
if t_count >= 1 or len(n_info) > 1:
|
else:
|
||||||
logger.info(n_info)
|
|
||||||
logger.info(f'tag/set ratio limit/seeding time for {t_count} .torrents(s)')
|
if t_count >= 1 or len(n_info) > 1:
|
||||||
if t_del >= 1:
|
logger.info(n_info)
|
||||||
logger.info(f'Deleted {t_del} .torrents(s) AND content files.')
|
logger.info(f'tag/set ratio limit/seeding time for {t_count} .torrents(s)')
|
||||||
logger.info(f'Deleted {t_del_cs} .torrents(s) (includes cross-seed torrents) AND content files.')
|
if t_del >= 1:
|
||||||
else:
|
logger.info(f'Deleted {t_del} .torrents(s) AND content files.')
|
||||||
logger.info('No torrents to tag with no hard links.')
|
logger.info(f'Deleted {t_del_cs} .torrents(s) (includes cross-seed torrents) AND content files.')
|
||||||
|
if tdel_tags >= 1:
|
||||||
|
logger.info(f'Deleted noHL tags/ remove ratio limit/seeding time for {tdel_tags} .torrents(s)')
|
||||||
|
else:
|
||||||
|
logger.info('No torrents to tag with no hard links.')
|
||||||
|
|
||||||
|
|
||||||
#will check if there are any hard links if it passes a file or folder
|
#will check if there are any hard links if it passes a file or folder
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue