mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-05 14:44:13 -04:00
Finishing up the tasks
This commit is contained in:
parent
221b5afb8b
commit
a11c281bcb
@ -11,7 +11,7 @@
|
||||
<Company>SDG</Company>
|
||||
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
<PackageVersion>1.0.12</PackageVersion>
|
||||
<PackageVersion>1.0.13</PackageVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -87,7 +87,7 @@ namespace Kyoo.Controllers
|
||||
}
|
||||
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;
|
||||
}
|
||||
}).Where(x => x != null).ToList();
|
||||
|
@ -36,7 +36,14 @@ namespace Kyoo.Controllers
|
||||
{
|
||||
(ITask task, string arguments) = _queuedTasks.Dequeue();
|
||||
_runningTask = task;
|
||||
await task.Run(_serviceProvider, _taskToken.Token, arguments);
|
||||
try
|
||||
{
|
||||
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
|
||||
{
|
||||
@ -106,7 +113,8 @@ namespace Kyoo.Controllers
|
||||
foreach (ITask task in prerunTasks)
|
||||
task.Run(_serviceProvider, _taskToken.Token);
|
||||
foreach (IPlugin plugin in _pluginManager.GetAllPlugins())
|
||||
_tasks.AddRange(plugin.Tasks.Select(x => (x, DateTime.Now + GetTaskDelay(x.Slug))));
|
||||
if (plugin.Tasks != null)
|
||||
_tasks.AddRange(plugin.Tasks.Select(x => (x, DateTime.Now + GetTaskDelay(x.Slug))));
|
||||
}
|
||||
|
||||
public IEnumerable<ITask> GetAllTasks()
|
||||
|
@ -26,5 +26,5 @@
|
||||
"profilePicturePath": "users/",
|
||||
"plugins": "plugins/",
|
||||
"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