-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginServiceRegistrator.cs
More file actions
38 lines (33 loc) · 1.32 KB
/
Copy pathPluginServiceRegistrator.cs
File metadata and controls
38 lines (33 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Jellyfin.Plugin.StashSync.GraphQL;
using Jellyfin.Plugin.StashSync.Providers;
using Jellyfin.Plugin.StashSync.Tasks;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.DependencyInjection;
namespace Jellyfin.Plugin.StashSync;
/// <summary>
/// Registers all StashSync services with Jellyfin's DI container.
/// </summary>
public class PluginServiceRegistrator : IPluginServiceRegistrator
{
/// <inheritdoc />
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
{
// HTTP client used for all Stash API calls
serviceCollection.AddHttpClient("StashSync")
.ConfigureHttpClient(client =>
{
client.Timeout = System.TimeSpan.FromSeconds(30);
});
// Core services
serviceCollection.AddSingleton<StashApiClient>();
serviceCollection.AddSingleton<StrmWriter>();
// Scheduled task
serviceCollection.AddSingleton<IScheduledTask, SyncStashGroupsTask>();
// Metadata providers
serviceCollection.AddSingleton<ILocalMetadataProvider, StashGroupMetadataProvider>();
serviceCollection.AddSingleton<IExternalId, StashExternalId>();
}
}