35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using Jellyfin.Plugin.MetaShark.Api;
|
|
using MediaBrowser.Controller;
|
|
using MediaBrowser.Controller.Plugins;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace Jellyfin.Plugin.MetaShark
|
|
{
|
|
/// <inheritdoc />
|
|
public class ServiceRegistrator : IPluginServiceRegistrator
|
|
{
|
|
/// <inheritdoc />
|
|
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
|
|
{
|
|
|
|
serviceCollection.AddSingleton((ctx) =>
|
|
{
|
|
return new DoubanApi(ctx.GetRequiredService<ILoggerFactory>());
|
|
});
|
|
serviceCollection.AddSingleton((ctx) =>
|
|
{
|
|
return new TmdbApi(ctx.GetRequiredService<ILoggerFactory>());
|
|
});
|
|
serviceCollection.AddSingleton((ctx) =>
|
|
{
|
|
return new OmdbApi(ctx.GetRequiredService<ILoggerFactory>());
|
|
});
|
|
serviceCollection.AddSingleton((ctx) =>
|
|
{
|
|
return new ImdbApi(ctx.GetRequiredService<ILoggerFactory>());
|
|
});
|
|
}
|
|
}
|
|
}
|