mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-10-31 02:27:11 -04:00 
			
		
		
		
	Finishing up the tasks
This commit is contained in:
		
							parent
							
								
									221b5afb8b
								
							
						
					
					
						commit
						a11c281bcb
					
				| @ -11,7 +11,7 @@ | |||||||
| 		<Company>SDG</Company> | 		<Company>SDG</Company> | ||||||
| 		<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression> | 		<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression> | ||||||
| 		<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | 		<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||||||
| 		<PackageVersion>1.0.12</PackageVersion> | 		<PackageVersion>1.0.13</PackageVersion> | ||||||
| 	</PropertyGroup> | 	</PropertyGroup> | ||||||
| 
 | 
 | ||||||
| 	<ItemGroup> | 	<ItemGroup> | ||||||
|  | |||||||
| @ -87,7 +87,7 @@ namespace Kyoo.Controllers | |||||||
| 				} | 				} | ||||||
| 				catch (Exception ex) | 				catch (Exception ex) | ||||||
| 				{ | 				{ | ||||||
| 					Console.Error.WriteLine($"Error loading the plugin at {path}.\nException: {ex.Message}"); | 					Console.Error.WriteLine($"Error loading the plugin at {path}.\nException: {ex.Message}\n\n"); | ||||||
| 					return null; | 					return null; | ||||||
| 				} | 				} | ||||||
| 			}).Where(x => x != null).ToList(); | 			}).Where(x => x != null).ToList(); | ||||||
|  | |||||||
| @ -36,8 +36,15 @@ namespace Kyoo.Controllers | |||||||
| 				{ | 				{ | ||||||
| 					(ITask task, string arguments) = _queuedTasks.Dequeue(); | 					(ITask task, string arguments) = _queuedTasks.Dequeue(); | ||||||
| 					_runningTask = task; | 					_runningTask = task; | ||||||
|  | 					try | ||||||
|  | 					{ | ||||||
| 						await task.Run(_serviceProvider, _taskToken.Token, arguments); | 						await task.Run(_serviceProvider, _taskToken.Token, arguments); | ||||||
| 					} | 					} | ||||||
|  | 					catch (Exception e) | ||||||
|  | 					{ | ||||||
|  | 						Console.Error.WriteLine($"An unhandled exception occured while running the task {task.Name}.\nInner exception: {e.Message}\n\n"); | ||||||
|  | 					} | ||||||
|  | 				} | ||||||
| 				else | 				else | ||||||
| 				{ | 				{ | ||||||
| 					await Task.Delay(10, cancellationToken); | 					await Task.Delay(10, cancellationToken); | ||||||
| @ -106,6 +113,7 @@ namespace Kyoo.Controllers | |||||||
| 			foreach (ITask task in prerunTasks) | 			foreach (ITask task in prerunTasks) | ||||||
| 				task.Run(_serviceProvider, _taskToken.Token); | 				task.Run(_serviceProvider, _taskToken.Token); | ||||||
| 			foreach (IPlugin plugin in _pluginManager.GetAllPlugins()) | 			foreach (IPlugin plugin in _pluginManager.GetAllPlugins()) | ||||||
|  | 				if (plugin.Tasks != null) | ||||||
| 					_tasks.AddRange(plugin.Tasks.Select(x => (x, DateTime.Now + GetTaskDelay(x.Slug)))); | 					_tasks.AddRange(plugin.Tasks.Select(x => (x, DateTime.Now + GetTaskDelay(x.Slug)))); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -26,5 +26,5 @@ | |||||||
|   "profilePicturePath": "users/", |   "profilePicturePath": "users/", | ||||||
|   "plugins": "plugins/", |   "plugins": "plugins/", | ||||||
|   "defaultPermissions": "read,play", |   "defaultPermissions": "read,play", | ||||||
|   "regex": "(\\/(?<Collection>.*)\\/)?.*\\/(?<ShowTitle>.+?)(( S(?<Season>\\d+)E(?<Episode>\\d+)| (?<Absolute>\\d+)))?\\.", |   "regex": "(\\/(?<Collection>.*)\\/)?.*\\/(?<ShowTitle>.+?)(( S(?<Season>\\d+)E(?<Episode>\\d+)| (?<Absolute>\\d+)))?\\." | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user