|
|
@ -46,57 +46,36 @@ namespace Ombi.Controllers.V1
|
|
|
|
[ApiController]
|
|
|
|
[ApiController]
|
|
|
|
public class IdentityController : Controller
|
|
|
|
public class IdentityController : Controller
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public IdentityController(OmbiUserManager user, IMapper mapper, RoleManager<IdentityRole> rm, IEmailProvider prov,
|
|
|
|
public IdentityController(OmbiUserManager user,
|
|
|
|
|
|
|
|
RoleManager<IdentityRole> rm,
|
|
|
|
|
|
|
|
IEmailProvider prov,
|
|
|
|
ISettingsService<EmailNotificationSettings> s,
|
|
|
|
ISettingsService<EmailNotificationSettings> s,
|
|
|
|
ISettingsService<CustomizationSettings> c,
|
|
|
|
ISettingsService<CustomizationSettings> c,
|
|
|
|
ISettingsService<OmbiSettings> ombiSettings,
|
|
|
|
ISettingsService<OmbiSettings> ombiSettings,
|
|
|
|
IWelcomeEmail welcome,
|
|
|
|
IWelcomeEmail welcome,
|
|
|
|
IMovieRequestRepository m,
|
|
|
|
|
|
|
|
ITvRequestRepository t,
|
|
|
|
|
|
|
|
ILogger<IdentityController> l,
|
|
|
|
ILogger<IdentityController> l,
|
|
|
|
IPlexApi plexApi,
|
|
|
|
IPlexApi plexApi,
|
|
|
|
ISettingsService<PlexSettings> settings,
|
|
|
|
ISettingsService<PlexSettings> settings,
|
|
|
|
IRepository<RequestLog> requestLog,
|
|
|
|
|
|
|
|
IRepository<Issues> issues,
|
|
|
|
|
|
|
|
IRepository<IssueComments> issueComments,
|
|
|
|
|
|
|
|
IRepository<NotificationUserId> notificationRepository,
|
|
|
|
|
|
|
|
IRepository<RequestSubscription> subscriptionRepository,
|
|
|
|
|
|
|
|
ISettingsService<UserManagementSettings> umSettings,
|
|
|
|
ISettingsService<UserManagementSettings> umSettings,
|
|
|
|
IRepository<UserNotificationPreferences> notificationPreferences,
|
|
|
|
IRepository<UserNotificationPreferences> notificationPreferences,
|
|
|
|
IRepository<UserQualityProfiles> userProfiles,
|
|
|
|
IRepository<UserQualityProfiles> userProfiles,
|
|
|
|
IMusicRequestRepository musicRepo,
|
|
|
|
|
|
|
|
IMovieRequestEngine movieRequestEngine,
|
|
|
|
|
|
|
|
ITvRequestEngine tvRequestEngine,
|
|
|
|
|
|
|
|
IMusicRequestEngine musicEngine,
|
|
|
|
|
|
|
|
IUserDeletionEngine deletionEngine,
|
|
|
|
IUserDeletionEngine deletionEngine,
|
|
|
|
IRequestLimitService requestLimitService,
|
|
|
|
IRequestLimitService requestLimitService,
|
|
|
|
ICacheService cacheService)
|
|
|
|
ICacheService cacheService)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
UserManager = user;
|
|
|
|
UserManager = user;
|
|
|
|
Mapper = mapper;
|
|
|
|
|
|
|
|
RoleManager = rm;
|
|
|
|
RoleManager = rm;
|
|
|
|
EmailProvider = prov;
|
|
|
|
EmailProvider = prov;
|
|
|
|
EmailSettings = s;
|
|
|
|
EmailSettings = s;
|
|
|
|
CustomizationSettings = c;
|
|
|
|
CustomizationSettings = c;
|
|
|
|
WelcomeEmail = welcome;
|
|
|
|
WelcomeEmail = welcome;
|
|
|
|
MovieRepo = m;
|
|
|
|
|
|
|
|
MusicRepo = musicRepo;
|
|
|
|
|
|
|
|
TvRepo = t;
|
|
|
|
|
|
|
|
_log = l;
|
|
|
|
_log = l;
|
|
|
|
_plexApi = plexApi;
|
|
|
|
_plexApi = plexApi;
|
|
|
|
_plexSettings = settings;
|
|
|
|
_plexSettings = settings;
|
|
|
|
_issuesRepository = issues;
|
|
|
|
|
|
|
|
_requestLogRepository = requestLog;
|
|
|
|
|
|
|
|
_issueCommentsRepository = issueComments;
|
|
|
|
|
|
|
|
OmbiSettings = ombiSettings;
|
|
|
|
OmbiSettings = ombiSettings;
|
|
|
|
_requestSubscriptionRepository = subscriptionRepository;
|
|
|
|
|
|
|
|
_notificationRepository = notificationRepository;
|
|
|
|
|
|
|
|
_userManagementSettings = umSettings;
|
|
|
|
_userManagementSettings = umSettings;
|
|
|
|
TvRequestEngine = tvRequestEngine;
|
|
|
|
|
|
|
|
MovieRequestEngine = movieRequestEngine;
|
|
|
|
|
|
|
|
_userNotificationPreferences = notificationPreferences;
|
|
|
|
_userNotificationPreferences = notificationPreferences;
|
|
|
|
_userQualityProfiles = userProfiles;
|
|
|
|
_userQualityProfiles = userProfiles;
|
|
|
|
MusicRequestEngine = musicEngine;
|
|
|
|
|
|
|
|
_deletionEngine = deletionEngine;
|
|
|
|
_deletionEngine = deletionEngine;
|
|
|
|
_requestLimitService = requestLimitService;
|
|
|
|
_requestLimitService = requestLimitService;
|
|
|
|
_cacheService = cacheService;
|
|
|
|
_cacheService = cacheService;
|
|
|
@ -108,27 +87,15 @@ namespace Ombi.Controllers.V1
|
|
|
|
private readonly ICacheService _cacheService;
|
|
|
|
private readonly ICacheService _cacheService;
|
|
|
|
|
|
|
|
|
|
|
|
private RoleManager<IdentityRole> RoleManager { get; }
|
|
|
|
private RoleManager<IdentityRole> RoleManager { get; }
|
|
|
|
private IMapper Mapper { get; }
|
|
|
|
|
|
|
|
private IEmailProvider EmailProvider { get; }
|
|
|
|
private IEmailProvider EmailProvider { get; }
|
|
|
|
private ISettingsService<EmailNotificationSettings> EmailSettings { get; }
|
|
|
|
private ISettingsService<EmailNotificationSettings> EmailSettings { get; }
|
|
|
|
private ISettingsService<CustomizationSettings> CustomizationSettings { get; }
|
|
|
|
private ISettingsService<CustomizationSettings> CustomizationSettings { get; }
|
|
|
|
private readonly ISettingsService<UserManagementSettings> _userManagementSettings;
|
|
|
|
private readonly ISettingsService<UserManagementSettings> _userManagementSettings;
|
|
|
|
private ISettingsService<OmbiSettings> OmbiSettings { get; }
|
|
|
|
private ISettingsService<OmbiSettings> OmbiSettings { get; }
|
|
|
|
private IWelcomeEmail WelcomeEmail { get; }
|
|
|
|
private IWelcomeEmail WelcomeEmail { get; }
|
|
|
|
private IMovieRequestRepository MovieRepo { get; }
|
|
|
|
|
|
|
|
private ITvRequestRepository TvRepo { get; }
|
|
|
|
|
|
|
|
private IMovieRequestEngine MovieRequestEngine { get; }
|
|
|
|
|
|
|
|
private IMusicRequestEngine MusicRequestEngine { get; }
|
|
|
|
|
|
|
|
private ITvRequestEngine TvRequestEngine { get; }
|
|
|
|
|
|
|
|
private IMusicRequestRepository MusicRepo { get; }
|
|
|
|
|
|
|
|
private readonly ILogger<IdentityController> _log;
|
|
|
|
private readonly ILogger<IdentityController> _log;
|
|
|
|
private readonly IPlexApi _plexApi;
|
|
|
|
private readonly IPlexApi _plexApi;
|
|
|
|
private readonly ISettingsService<PlexSettings> _plexSettings;
|
|
|
|
private readonly ISettingsService<PlexSettings> _plexSettings;
|
|
|
|
private readonly IRepository<Issues> _issuesRepository;
|
|
|
|
|
|
|
|
private readonly IRepository<IssueComments> _issueCommentsRepository;
|
|
|
|
|
|
|
|
private readonly IRepository<RequestLog> _requestLogRepository;
|
|
|
|
|
|
|
|
private readonly IRepository<NotificationUserId> _notificationRepository;
|
|
|
|
|
|
|
|
private readonly IRepository<RequestSubscription> _requestSubscriptionRepository;
|
|
|
|
|
|
|
|
private readonly IRepository<UserNotificationPreferences> _userNotificationPreferences;
|
|
|
|
private readonly IRepository<UserNotificationPreferences> _userNotificationPreferences;
|
|
|
|
private readonly IRepository<UserQualityProfiles> _userQualityProfiles;
|
|
|
|
private readonly IRepository<UserQualityProfiles> _userQualityProfiles;
|
|
|
|
|
|
|
|
|
|
|
@ -258,6 +225,8 @@ namespace Ombi.Controllers.V1
|
|
|
|
await CreateRole(OmbiRoles.ReceivesNewsletter);
|
|
|
|
await CreateRole(OmbiRoles.ReceivesNewsletter);
|
|
|
|
await CreateRole(OmbiRoles.ManageOwnRequests);
|
|
|
|
await CreateRole(OmbiRoles.ManageOwnRequests);
|
|
|
|
await CreateRole(OmbiRoles.EditCustomPage);
|
|
|
|
await CreateRole(OmbiRoles.EditCustomPage);
|
|
|
|
|
|
|
|
await CreateRole(OmbiRoles.EditCustomPage);
|
|
|
|
|
|
|
|
await CreateRole(OmbiRoles.Request4KMovie);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async Task CreateRole(string role)
|
|
|
|
private async Task CreateRole(string role)
|
|
|
|