Port to Jellyfin 10.11 (net9.0, IHostedService)

IServerEntryPoint was removed in favor of IHostedService; migrated
PlaybackScrobbler and updated PluginServiceRegistrator accordingly
(RegisterServices now takes IServerApplicationHost, AnilistApi moved
to a singleton so the hosted service can depend on it). Bumped
TargetFramework to net9.0 and targetAbi to 10.11.0.0.

Also fixed Endpoints.cs, which referenced an "DefaultAuthorization"
authorization policy that no longer resolves for plugin controllers
on 10.11, causing every API call to 500 instead of 401'ing when
unauthenticated. Verified end-to-end against a live 10.11.11 server:
plugin loads, OAuth re-auth works, and a real scrobble to Anilist
succeeded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 23:10:40 +02:00
parent d5147340a8
commit c17d62fc62
5 changed files with 25 additions and 33 deletions
@@ -1,5 +1,7 @@
using Jellyfin.Plugin.AnilistSync.API;
using MediaBrowser.Common.Plugins;
using Jellyfin.Plugin.AnilistSync.Services;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Plugins;
using Microsoft.Extensions.DependencyInjection;
namespace Jellyfin.Plugin.AnilistSync
@@ -8,9 +10,10 @@ namespace Jellyfin.Plugin.AnilistSync
public class PluginServiceRegistrator : IPluginServiceRegistrator
{
/// <inheritdoc />
public void RegisterServices(IServiceCollection serviceCollection)
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
{
serviceCollection.AddScoped<AnilistApi>();
serviceCollection.AddSingleton<AnilistApi>();
serviceCollection.AddHostedService<PlaybackScrobbler>();
}
}
}