Ship the plugin sources, release zip, and SeerrFin-style manifest.json so Jellyfin can install from the Gitea raw repository URL. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
1.1 KiB
C#
29 lines
1.1 KiB
C#
using Jellyfin.Plugin.Request.Hosting;
|
|
using Jellyfin.Plugin.Request.Storage;
|
|
using Jellyfin.Plugin.Request.Tmdb;
|
|
using MediaBrowser.Controller;
|
|
using MediaBrowser.Controller.Plugins;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Jellyfin.Plugin.Request;
|
|
|
|
/// <summary>
|
|
/// Registers plugin services with the Jellyfin DI container.
|
|
/// </summary>
|
|
public sealed class PluginServiceRegistrator : IPluginServiceRegistrator
|
|
{
|
|
/// <inheritdoc />
|
|
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
|
|
{
|
|
serviceCollection.AddSingleton<RequestStore>();
|
|
serviceCollection.AddHttpClient(TmdbClient.HttpClientName, client =>
|
|
{
|
|
client.BaseAddress = new System.Uri("https://api.themoviedb.org/3/");
|
|
client.Timeout = System.TimeSpan.FromSeconds(30);
|
|
client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
|
|
});
|
|
serviceCollection.AddSingleton<TmdbClient>();
|
|
serviceCollection.AddHostedService<WebNavInjector>();
|
|
}
|
|
}
|