|
|
|
@ -16,6 +16,7 @@ using Ombi.Api.Plex;
|
|
|
|
|
using Ombi.Attributes;
|
|
|
|
|
using Ombi.Config;
|
|
|
|
|
using Ombi.Core.Authentication;
|
|
|
|
|
using Ombi.Core.Engine.Interfaces;
|
|
|
|
|
using Ombi.Core.Helpers;
|
|
|
|
|
using Ombi.Core.Models.UI;
|
|
|
|
|
using Ombi.Core.Settings;
|
|
|
|
@ -62,7 +63,9 @@ namespace Ombi.Controllers
|
|
|
|
|
IRepository<RequestSubscription> subscriptionRepository,
|
|
|
|
|
ISettingsService<UserManagementSettings> umSettings,
|
|
|
|
|
IRepository<UserNotificationPreferences> notificationPreferences,
|
|
|
|
|
IMusicRequestRepository musicRepo)
|
|
|
|
|
IMusicRequestRepository musicRepo),
|
|
|
|
|
IMovieRequestEngine movieRequestEngine,
|
|
|
|
|
ITvRequestEngine tvRequestEngine)
|
|
|
|
|
{
|
|
|
|
|
UserManager = user;
|
|
|
|
|
Mapper = mapper;
|
|
|
|
@ -84,6 +87,8 @@ namespace Ombi.Controllers
|
|
|
|
|
_requestSubscriptionRepository = subscriptionRepository;
|
|
|
|
|
_notificationRepository = notificationRepository;
|
|
|
|
|
_userManagementSettings = umSettings;
|
|
|
|
|
TvRequestEngine = tvRequestEngine;
|
|
|
|
|
MovieRequestEngine = movieRequestEngine;
|
|
|
|
|
_userNotificationPreferences = notificationPreferences;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -98,6 +103,8 @@ namespace Ombi.Controllers
|
|
|
|
|
private IWelcomeEmail WelcomeEmail { get; }
|
|
|
|
|
private IMovieRequestRepository MovieRepo { get; }
|
|
|
|
|
private ITvRequestRepository TvRepo { get; }
|
|
|
|
|
private IMovieRequestEngine MovieRequestEngine { get; }
|
|
|
|
|
private ITvRequestEngine TvRequestEngine { get; }
|
|
|
|
|
private IMusicRequestRepository MusicRepo { get; }
|
|
|
|
|
private readonly ILogger<IdentityController> _log;
|
|
|
|
|
private readonly IPlexApi _plexApi;
|
|
|
|
@ -109,7 +116,6 @@ namespace Ombi.Controllers
|
|
|
|
|
private readonly IRepository<RequestSubscription> _requestSubscriptionRepository;
|
|
|
|
|
private readonly IRepository<UserNotificationPreferences> _userNotificationPreferences;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is what the Wizard will call when creating the user for the very first time.
|
|
|
|
|
/// This should never be called after this.
|
|
|
|
@ -323,6 +329,16 @@ namespace Ombi.Controllers
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (vm.EpisodeRequestLimit > 0)
|
|
|
|
|
{
|
|
|
|
|
vm.EpisodeRequestQuota = await TvRequestEngine.GetRemainingRequests(user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (vm.MovieRequestLimit > 0)
|
|
|
|
|
{
|
|
|
|
|
vm.MovieRequestQuota = await MovieRequestEngine.GetRemainingRequests(user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return vm;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|