mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-10-26 05:56:58 +08:00
resolves #115
This commit is contained in:
parent
acb23f73ba
commit
ebdf085a24
5 changed files with 18 additions and 5 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
4.0.9-develop6
|
||||
4.0.9-develop7
|
||||
|
|
|
|||
|
|
@ -169,6 +169,15 @@ class Config:
|
|||
self.data, "share_limits_tag", parent="settings", default=share_limits_tag
|
||||
),
|
||||
"cross_seed_tag": self.util.check_for_attribute(self.data, "cross_seed_tag", parent="settings", default="cross-seed"),
|
||||
"cat_filter_completed": self.util.check_for_attribute(
|
||||
self.data, "cat_filter_completed", parent="settings", var_type="bool", default=True
|
||||
),
|
||||
"share_limits_filter_completed": self.util.check_for_attribute(
|
||||
self.data, "share_limits_filter_completed", parent="settings", var_type="bool", default=True
|
||||
),
|
||||
"tag_nohardlinks_filter_completed": self.util.check_for_attribute(
|
||||
self.data, "tag_nohardlinks_filter_completed", parent="settings", var_type="bool", default=True
|
||||
),
|
||||
}
|
||||
|
||||
self.tracker_error_tag = self.settings["tracker_error_tag"]
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class Category:
|
|||
self.torrents_updated = [] # List of torrents updated
|
||||
self.notify_attr = [] # List of single torrent attributes to send to notifiarr
|
||||
self.uncategorized_mapping = "Uncategorized"
|
||||
self.status_filter = "completed" if self.config.settings["cat_filter_completed"] else "all"
|
||||
|
||||
self.category()
|
||||
self.config.webhooks_factory.notify(self.torrents_updated, self.notify_attr, group_by="category")
|
||||
|
|
@ -21,7 +22,7 @@ class Category:
|
|||
def category(self):
|
||||
"""Update category for torrents that don't have any category defined and returns total number categories updated"""
|
||||
logger.separator("Updating Categories", space=False, border=False)
|
||||
torrent_list = self.qbt.get_torrents({"category": "", "status_filter": "completed"})
|
||||
torrent_list = self.qbt.get_torrents({"category": "", "status_filter": self.status_filter})
|
||||
for torrent in torrent_list:
|
||||
new_cat = self.get_tracker_cat(torrent) or self.qbt.get_category(torrent.save_path)
|
||||
if new_cat == self.uncategorized_mapping:
|
||||
|
|
@ -32,7 +33,7 @@ class Category:
|
|||
# Change categories
|
||||
if self.config.cat_change:
|
||||
for old_cat in self.config.cat_change:
|
||||
torrent_list = self.qbt.get_torrents({"category": old_cat, "status_filter": "completed"})
|
||||
torrent_list = self.qbt.get_torrents({"category": old_cat, "status_filter": self.status_filter})
|
||||
for torrent in torrent_list:
|
||||
new_cat = self.config.cat_change[old_cat]
|
||||
self.update_cat(torrent, new_cat, True)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class ShareLimits:
|
|||
# meets the criteria for ratio limit/seed limit for deletion
|
||||
self.stats_deleted_contents = 0 # counter for the number of torrents that \
|
||||
# meets the criteria for ratio limit/seed limit for deletion including contents \
|
||||
self.status_filter = "completed" if self.config.settings["share_limits_filter_completed"] else "all"
|
||||
|
||||
self.tdel_dict = {} # dictionary to track the torrent names and content path that meet the deletion criteria
|
||||
self.root_dir = qbit_manager.config.root_dir # root directory of torrents
|
||||
|
|
@ -40,7 +41,7 @@ class ShareLimits:
|
|||
def update_share_limits(self):
|
||||
"""Updates share limits for torrents based on grouping"""
|
||||
logger.separator("Updating Share Limits based on priority", space=False, border=False)
|
||||
torrent_list = self.qbt.get_torrents({"status_filter": "completed"})
|
||||
torrent_list = self.qbt.get_torrents({"status_filter": self.status_filter})
|
||||
self.assign_torrents_to_group(torrent_list)
|
||||
for group_name, group_config in self.share_limits_config.items():
|
||||
torrents = group_config["torrents"]
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ class TagNoHardLinks:
|
|||
self.torrents_updated_untagged = [] # List of torrents updated
|
||||
self.notify_attr_untagged = [] # List of single torrent attributes to send to notifiarr
|
||||
|
||||
self.status_filter = "completed" if self.config.settings["tag_nohardlinks_filter_completed"] else "all"
|
||||
|
||||
self.tag_nohardlinks()
|
||||
|
||||
self.config.webhooks_factory.notify(self.torrents_updated_tagged, self.notify_attr_tagged, group_by="tag")
|
||||
|
|
@ -87,7 +89,7 @@ class TagNoHardLinks:
|
|||
nohardlinks = self.nohardlinks
|
||||
check_hardlinks = util.CheckHardLinks(self.root_dir, self.remote_dir)
|
||||
for category in nohardlinks:
|
||||
torrent_list = self.qbt.get_torrents({"category": category, "status_filter": "completed"})
|
||||
torrent_list = self.qbt.get_torrents({"category": category, "status_filter": self.status_filter})
|
||||
if len(torrent_list) == 0:
|
||||
ex = (
|
||||
"No torrents found in the category ("
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue