Add quota fields to user view model

This commit is contained in:
Kenton Royal 2018-09-05 00:12:19 +01:00
parent cfd9deb17e
commit 9c574fb7e9
7 changed files with 39 additions and 7 deletions

View file

@ -615,9 +615,13 @@ namespace Ombi.Core.Engine
return new RequestEngineResult { Result = true };
}
public async Task<RequestQuotaCountModel> GetRemainingRequests()
public async Task<RequestQuotaCountModel> GetRemainingRequests(OmbiUser user)
{
OmbiUser user = await GetUser();
if (user == null)
{
user = await GetUser();
}
int limit = user.EpisodeRequestLimit ?? 0;
if (limit <= 0)