mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-30 11:22:53 +01:00
Merge pull request #3194 from OancaAndrei/syncplay-enhanced
SyncPlay for TV series (and Music)
This commit is contained in:
@@ -82,13 +82,11 @@ namespace Jellyfin.Server
|
||||
ServiceCollection.AddSingleton<IUserManager, UserManager>();
|
||||
ServiceCollection.AddSingleton<IDisplayPreferencesManager, DisplayPreferencesManager>();
|
||||
|
||||
ServiceCollection.AddScoped<IWebSocketListener, SessionWebSocketListener>();
|
||||
ServiceCollection.AddScoped<IWebSocketListener, ActivityLogWebSocketListener>();
|
||||
ServiceCollection.AddScoped<IWebSocketListener, ScheduledTasksWebSocketListener>();
|
||||
ServiceCollection.AddScoped<IWebSocketListener, SessionInfoWebSocketListener>();
|
||||
|
||||
// TODO fix circular dependency on IWebSocketManager
|
||||
ServiceCollection.AddScoped(serviceProvider => new Lazy<IEnumerable<IWebSocketListener>>(serviceProvider.GetRequiredService<IEnumerable<IWebSocketListener>>));
|
||||
// TODO search the assemblies instead of adding them manually?
|
||||
ServiceCollection.AddSingleton<IWebSocketListener, SessionWebSocketListener>();
|
||||
ServiceCollection.AddSingleton<IWebSocketListener, ActivityLogWebSocketListener>();
|
||||
ServiceCollection.AddSingleton<IWebSocketListener, ScheduledTasksWebSocketListener>();
|
||||
ServiceCollection.AddSingleton<IWebSocketListener, SessionInfoWebSocketListener>();
|
||||
|
||||
base.RegisterServices();
|
||||
}
|
||||
|
||||
@@ -15,9 +15,11 @@ using Jellyfin.Api.Auth.IgnoreParentalControlPolicy;
|
||||
using Jellyfin.Api.Auth.LocalAccessOrRequiresElevationPolicy;
|
||||
using Jellyfin.Api.Auth.LocalAccessPolicy;
|
||||
using Jellyfin.Api.Auth.RequiresElevationPolicy;
|
||||
using Jellyfin.Api.Auth.SyncPlayAccessPolicy;
|
||||
using Jellyfin.Api.Constants;
|
||||
using Jellyfin.Api.Controllers;
|
||||
using Jellyfin.Api.ModelBinders;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Server.Configuration;
|
||||
using Jellyfin.Server.Filters;
|
||||
using Jellyfin.Server.Formatters;
|
||||
@@ -58,6 +60,7 @@ namespace Jellyfin.Server.Extensions
|
||||
serviceCollection.AddSingleton<IAuthorizationHandler, LocalAccessHandler>();
|
||||
serviceCollection.AddSingleton<IAuthorizationHandler, LocalAccessOrRequiresElevationHandler>();
|
||||
serviceCollection.AddSingleton<IAuthorizationHandler, RequiresElevationHandler>();
|
||||
serviceCollection.AddSingleton<IAuthorizationHandler, SyncPlayAccessHandler>();
|
||||
return serviceCollection.AddAuthorizationCore(options =>
|
||||
{
|
||||
options.AddPolicy(
|
||||
@@ -123,6 +126,20 @@ namespace Jellyfin.Server.Extensions
|
||||
policy.AddAuthenticationSchemes(AuthenticationSchemes.CustomAuthentication);
|
||||
policy.AddRequirements(new RequiresElevationRequirement());
|
||||
});
|
||||
options.AddPolicy(
|
||||
Policies.SyncPlayAccess,
|
||||
policy =>
|
||||
{
|
||||
policy.AddAuthenticationSchemes(AuthenticationSchemes.CustomAuthentication);
|
||||
policy.AddRequirements(new SyncPlayAccessRequirement(SyncPlayAccess.JoinGroups));
|
||||
});
|
||||
options.AddPolicy(
|
||||
Policies.SyncPlayCreateGroupAccess,
|
||||
policy =>
|
||||
{
|
||||
policy.AddAuthenticationSchemes(AuthenticationSchemes.CustomAuthentication);
|
||||
policy.AddRequirements(new SyncPlayAccessRequirement(SyncPlayAccess.CreateAndJoinGroups));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user