mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-16 03:54:17 -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,7 +36,14 @@ namespace Kyoo.Controllers
|
|||||||
{
|
{
|
||||||
(ITask task, string arguments) = _queuedTasks.Dequeue();
|
(ITask task, string arguments) = _queuedTasks.Dequeue();
|
||||||
_runningTask = task;
|
_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
|
else
|
||||||
{
|
{
|
||||||
@ -106,7 +113,8 @@ 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())
|
||||||
_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()
|
public IEnumerable<ITask> GetAllTasks()
|
||||||
|
@ -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