Merge pull request #32 from jonbranan/fix_torrent_count
#31 and lots of other changes
This commit was merged in pull request #32.
	This commit is contained in:
		| @@ -76,8 +76,8 @@ class Qbt: | ||||
|             list_first_tor(self) | ||||
|         build_tor_list(self) | ||||
|         process_counts(self) | ||||
|         # if self.use_log: | ||||
|         #     torrent_count(self) | ||||
|         if self.use_log: | ||||
|             torrent_count(self) | ||||
|         tor_processor(self) | ||||
|         if self.use_log: | ||||
|             print_processor(self) | ||||
|   | ||||
							
								
								
									
										30
									
								
								qlogging.py
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								qlogging.py
									
									
									
									
									
								
							| @@ -42,17 +42,6 @@ def tor_notify_summary(self): | ||||
|     Marked for deletion: {len(self.torrent_hash_delete_list)}\n\ | ||||
|     {self.extm}", title="--- qbit-maid summary ---") | ||||
|  | ||||
| def getunixtimestamp(self): | ||||
|     """Used for debuging and development related to unixtimestamps, not used in main script but useful""" | ||||
|     self.uts = self.t.time() | ||||
|     self.tl.info(self.uts) | ||||
|  | ||||
| def writetor(self, filepath='./torrentinfo.json'): | ||||
|     """Write all torrent data to a file. | ||||
|     Useful for development of new features. | ||||
|     """ | ||||
|     pass | ||||
|  | ||||
| def list_first_tor(self, index=0): | ||||
|     """Only lists the first torrent""" | ||||
|     self.tl.debug('First torrent in the list:') | ||||
| @@ -68,25 +57,12 @@ def list_qbit_api_info(self): | ||||
|  | ||||
| def torrent_count(self): | ||||
|     """write torrent counts to log file""" | ||||
|     #Doesn't work because tracker_list doesn't have a count property. Each object does. List comprehension? | ||||
|     self.tl.debug(f'torrents that are protected {self.tracker_list.count("ipt")}') | ||||
|     self.tl.debug(f'torrents that aren\'t protected {self.tracker_list.count("public")}') | ||||
|  | ||||
| def torlisttags(self): | ||||
|     pass | ||||
|  | ||||
| def debugpremecal(self): | ||||
|     for torrent in self.torrent_list: | ||||
|         if torrent['infohash_v1'] == 'a89b484ea375094af53ce89ecbea14bf086d6284': | ||||
|             print(torrent["name"][0:20]) | ||||
|             print(torrent['added_on'] + self.minimum_age >= self.t.time()) | ||||
|     self.tl.debug(f'*** Torrents with tag["{self.tracker_protected_tag}"] {self.c[self.tracker_protected_tag]} ***') | ||||
|     self.tl.debug(f'*** Torrents with tag["{self.tracker_non_protected_tag}"] {self.c[self.tracker_non_protected_tag]} ***') | ||||
|  | ||||
| def get_script_runtime(self): | ||||
|     elapsed_time = self.et - self.st | ||||
|     if self.use_log: | ||||
|         self.tl.info(f'Execution time: [{elapsed_time}]') | ||||
|     if self.use_pushover: | ||||
|         self.extm = f"Execution time: [{elapsed_time}]" | ||||
|  | ||||
| def getobjecttype(object): | ||||
|     print(type(object)) | ||||
|         self.extm = f"Execution time: [{elapsed_time}]" | ||||
| @@ -45,7 +45,8 @@ def tor_delete(self): | ||||
|     if self.use_log: | ||||
|         self.tl.debug('Hash list submitted for deletion:') | ||||
|         self.tl.debug(self.torrent_hash_delete_list) | ||||
|     self.qbt_client.torrents_delete(True, self.torrent_hash_delete_list) | ||||
|     if self.torrent_hash_delete_list: | ||||
|         self.qbt_client.torrents_delete(True, self.torrent_hash_delete_list) | ||||
|  | ||||
| def is_downloading(state): | ||||
|     if state == 'downloading': | ||||
|   | ||||
		Reference in New Issue
	
	Block a user