mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-10-31 10:37:13 -04:00 
			
		
		
		
	Run monitor before scan
This commit is contained in:
		
							parent
							
								
									faf8832572
								
							
						
					
					
						commit
						fc7926c2cc
					
				| @ -1,4 +1,5 @@ | ||||
| async def main(): | ||||
| 	import asyncio | ||||
| 	import os | ||||
| 	import logging | ||||
| 	import sys | ||||
| @ -38,8 +39,9 @@ async def main(): | ||||
| 	) as client: | ||||
| 		try: | ||||
| 			scanner = Scanner(client, languages=languages.split(","), api_key=api_key) | ||||
| 			await scanner.scan(path) | ||||
| 			logging.info("Scan finished. Starting to monitor...") | ||||
| 			await monitor(path, scanner) | ||||
| 			await asyncio.gather( | ||||
| 				monitor(path, scanner), | ||||
| 				scanner.scan(path), | ||||
| 			) | ||||
| 		except ProviderError as e: | ||||
| 			logging.error(e) | ||||
|  | ||||
| @ -54,6 +54,7 @@ class Scanner: | ||||
| 		# We batch videos by 20 because too mutch at once kinda DDOS everything. | ||||
| 		for group in batch(iter(videos), 20): | ||||
| 			await asyncio.gather(*map(self.identify, group)) | ||||
| 		logging.info("Scan finished.") | ||||
| 
 | ||||
| 	async def get_registered_paths(self) -> List[str]: | ||||
| 		paths = None | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user