Make Entrypoint run at start (#109)
* Update Entrypoint.cs * Update PluginServiceRegistrator.cs
This commit is contained in:
parent
36afd6ce53
commit
e37de35445
@ -84,6 +84,13 @@ public class Entrypoint : IHostedService, IDisposable
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Task StopAsync(CancellationToken cancellationToken)
|
public Task StopAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
_libraryManager.ItemAdded -= OnItemAdded;
|
||||||
|
_libraryManager.ItemUpdated -= OnItemModified;
|
||||||
|
_taskManager.TaskCompleted -= OnLibraryRefresh;
|
||||||
|
|
||||||
|
// Stop the timer
|
||||||
|
_queueTimer.Change(Timeout.Infinite, 0);
|
||||||
|
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,10 +290,6 @@ public class Entrypoint : IHostedService, IDisposable
|
|||||||
{
|
{
|
||||||
if (!dispose)
|
if (!dispose)
|
||||||
{
|
{
|
||||||
_libraryManager.ItemAdded -= OnItemAdded;
|
|
||||||
_libraryManager.ItemUpdated -= OnItemModified;
|
|
||||||
_taskManager.TaskCompleted -= OnLibraryRefresh;
|
|
||||||
|
|
||||||
_queueTimer.Dispose();
|
_queueTimer.Dispose();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -13,6 +13,7 @@ namespace ConfusedPolarBear.Plugin.IntroSkipper
|
|||||||
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
|
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
|
||||||
{
|
{
|
||||||
serviceCollection.AddHostedService<AutoSkip>();
|
serviceCollection.AddHostedService<AutoSkip>();
|
||||||
|
serviceCollection.AddHostedService<Entrypoint>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user