mirror of
				https://github.com/StuffAnThings/qbit_manage.git
				synced 2025-10-28 07:00:19 +08:00 
			
		
		
		
	update nohardlinks config
This commit is contained in:
		
							parent
							
								
									580351f6d5
								
							
						
					
					
						commit
						58ecbcfe2e
					
				
					 2 changed files with 22 additions and 109 deletions
				
			
		|  | @ -126,14 +126,16 @@ nohardlinks: | ||||||
|   # Tag Movies/Series that are not hard linked outside the root directory |   # Tag Movies/Series that are not hard linked outside the root directory | ||||||
|   # Mandatory to fill out directory parameter above to use this function (root_dir/remote_dir) |   # Mandatory to fill out directory parameter above to use this function (root_dir/remote_dir) | ||||||
|   # This variable should be set to your category name of your completed movies/completed series in qbit. Acceptable variable can be any category you would like to tag if there are no hardlinks found |   # This variable should be set to your category name of your completed movies/completed series in qbit. Acceptable variable can be any category you would like to tag if there are no hardlinks found | ||||||
|   movies-completed: |   - movies-completed-4k | ||||||
|  |   - series-completed-4k | ||||||
|  |   - movies-completed: | ||||||
|       # <OPTIONAL> exclude_tags var: Will exclude torrents with any of the following tags when searching through the category. |       # <OPTIONAL> exclude_tags var: Will exclude torrents with any of the following tags when searching through the category. | ||||||
|       exclude_tags: |       exclude_tags: | ||||||
|         - Beyond-HD |         - Beyond-HD | ||||||
|         - AnimeBytes |         - AnimeBytes | ||||||
|         - MaM |         - MaM | ||||||
|   # Can have additional categories set with separate ratio/seeding times defined. |   # Can have additional categories set with separate ratio/seeding times defined. | ||||||
|   series-completed: |   - series-completed: | ||||||
|       # <OPTIONAL> exclude_tags var: Will exclude torrents with any of the following tags when searching through the category. |       # <OPTIONAL> exclude_tags var: Will exclude torrents with any of the following tags when searching through the category. | ||||||
|       exclude_tags: |       exclude_tags: | ||||||
|         - Beyond-HD |         - Beyond-HD | ||||||
|  |  | ||||||
|  | @ -263,105 +263,16 @@ class Config: | ||||||
|         if "nohardlinks" in self.data and self.commands["tag_nohardlinks"]: |         if "nohardlinks" in self.data and self.commands["tag_nohardlinks"]: | ||||||
|             self.nohardlinks = {} |             self.nohardlinks = {} | ||||||
|             for cat in self.data["nohardlinks"]: |             for cat in self.data["nohardlinks"]: | ||||||
|                 if cat in list(self.data["cat"].keys()): |                 if isinstance(cat, dict): | ||||||
|                     is_max_ratio_defined = self.data["nohardlinks"][cat].get("max_ratio") |                     cat_str = list(cat.keys())[0] | ||||||
|                     is_max_seeding_time_defined = self.data["nohardlinks"][cat].get("max_seeding_time") |                     self.nohardlinks[cat_str] = {} | ||||||
|  |                     exclude_tags = cat[cat_str].get("exclude_tags", None) | ||||||
|  |                     if isinstance(exclude_tags, str): | ||||||
|  |                         exclude_tags = [exclude_tags] | ||||||
|  |                     self.nohardlinks[cat_str]["exclude_tags"] = exclude_tags | ||||||
|  |                 elif isinstance(cat, str): | ||||||
|                     self.nohardlinks[cat] = {} |                     self.nohardlinks[cat] = {} | ||||||
|                     self.nohardlinks[cat]["exclude_tags"] = self.util.check_for_attribute( |                     self.nohardlinks[cat]["exclude_tags"] = None | ||||||
|                         self.data, |  | ||||||
|                         "exclude_tags", |  | ||||||
|                         parent="nohardlinks", |  | ||||||
|                         subparent=cat, |  | ||||||
|                         var_type="list", |  | ||||||
|                         default_is_none=True, |  | ||||||
|                         do_print=False, |  | ||||||
|                     ) |  | ||||||
|                     self.nohardlinks[cat]["cleanup"] = self.util.check_for_attribute( |  | ||||||
|                         self.data, "cleanup", parent="nohardlinks", subparent=cat, var_type="bool", default=False, do_print=False |  | ||||||
|                     ) |  | ||||||
|                     if is_max_ratio_defined or is_max_seeding_time_defined: |  | ||||||
|                         self.nohardlinks[cat]["max_ratio"] = self.util.check_for_attribute( |  | ||||||
|                             self.data, |  | ||||||
|                             "max_ratio", |  | ||||||
|                             parent="nohardlinks", |  | ||||||
|                             subparent=cat, |  | ||||||
|                             var_type="float", |  | ||||||
|                             min_int=-2, |  | ||||||
|                             do_print=False, |  | ||||||
|                             default=-1, |  | ||||||
|                             save=False, |  | ||||||
|                         ) |  | ||||||
|                         self.nohardlinks[cat]["max_seeding_time"] = self.util.check_for_attribute( |  | ||||||
|                             self.data, |  | ||||||
|                             "max_seeding_time", |  | ||||||
|                             parent="nohardlinks", |  | ||||||
|                             subparent=cat, |  | ||||||
|                             var_type="int", |  | ||||||
|                             min_int=-2, |  | ||||||
|                             do_print=False, |  | ||||||
|                             default=-1, |  | ||||||
|                             save=False, |  | ||||||
|                         ) |  | ||||||
|                     else: |  | ||||||
|                         self.nohardlinks[cat]["max_ratio"] = self.util.check_for_attribute( |  | ||||||
|                             self.data, |  | ||||||
|                             "max_ratio", |  | ||||||
|                             parent="nohardlinks", |  | ||||||
|                             subparent=cat, |  | ||||||
|                             var_type="float", |  | ||||||
|                             min_int=-2, |  | ||||||
|                             do_print=False, |  | ||||||
|                             default_is_none=True, |  | ||||||
|                             save=False, |  | ||||||
|                         ) |  | ||||||
|                         self.nohardlinks[cat]["max_seeding_time"] = self.util.check_for_attribute( |  | ||||||
|                             self.data, |  | ||||||
|                             "max_seeding_time", |  | ||||||
|                             parent="nohardlinks", |  | ||||||
|                             subparent=cat, |  | ||||||
|                             var_type="int", |  | ||||||
|                             min_int=-2, |  | ||||||
|                             do_print=False, |  | ||||||
|                             default_is_none=True, |  | ||||||
|                             save=False, |  | ||||||
|                         ) |  | ||||||
|                     self.nohardlinks[cat]["min_seeding_time"] = self.util.check_for_attribute( |  | ||||||
|                         self.data, |  | ||||||
|                         "min_seeding_time", |  | ||||||
|                         parent="nohardlinks", |  | ||||||
|                         subparent=cat, |  | ||||||
|                         var_type="int", |  | ||||||
|                         min_int=0, |  | ||||||
|                         do_print=False, |  | ||||||
|                         default=0, |  | ||||||
|                         save=False, |  | ||||||
|                     ) |  | ||||||
|                     self.nohardlinks[cat]["limit_upload_speed"] = self.util.check_for_attribute( |  | ||||||
|                         self.data, |  | ||||||
|                         "limit_upload_speed", |  | ||||||
|                         parent="nohardlinks", |  | ||||||
|                         subparent=cat, |  | ||||||
|                         var_type="int", |  | ||||||
|                         min_int=-1, |  | ||||||
|                         do_print=False, |  | ||||||
|                         default=-1, |  | ||||||
|                         save=False, |  | ||||||
|                     ) |  | ||||||
|                     self.nohardlinks[cat]["resume_torrent_after_untagging_noHL"] = self.util.check_for_attribute( |  | ||||||
|                         self.data, |  | ||||||
|                         "resume_torrent_after_untagging_noHL", |  | ||||||
|                         parent="nohardlinks", |  | ||||||
|                         subparent=cat, |  | ||||||
|                         var_type="bool", |  | ||||||
|                         default=True, |  | ||||||
|                         do_print=False, |  | ||||||
|                         save=False, |  | ||||||
|                     ) |  | ||||||
|                 else: |  | ||||||
|                     err = f"Config Error: Category {cat} is defined under nohardlinks attribute " |  | ||||||
|                     "but is not defined in the cat attribute." |  | ||||||
|                     self.notify(err, "Config") |  | ||||||
|                     raise Failed(err) |  | ||||||
|         else: |         else: | ||||||
|             if self.commands["tag_nohardlinks"]: |             if self.commands["tag_nohardlinks"]: | ||||||
|                 err = "Config Error: nohardlinks attribute max_ratio not found" |                 err = "Config Error: nohardlinks attribute max_ratio not found" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue