mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-14 17:22:54 -07:00
Add methods to interface and add model class
This commit is contained in:
parent
55910d6586
commit
861e677151
6 changed files with 44 additions and 2 deletions
|
@ -17,7 +17,5 @@ namespace Ombi.Core.Engine.Interfaces
|
||||||
Task<RequestEngineResult> ApproveMovie(MovieRequests request);
|
Task<RequestEngineResult> ApproveMovie(MovieRequests request);
|
||||||
Task<RequestEngineResult> ApproveMovieById(int requestId);
|
Task<RequestEngineResult> ApproveMovieById(int requestId);
|
||||||
Task<RequestEngineResult> DenyMovieById(int modelId);
|
Task<RequestEngineResult> DenyMovieById(int modelId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Ombi.Core.Models;
|
||||||
using Ombi.Core.Models.Requests;
|
using Ombi.Core.Models.Requests;
|
||||||
using Ombi.Core.Models.UI;
|
using Ombi.Core.Models.UI;
|
||||||
using Ombi.Store.Entities;
|
using Ombi.Store.Entities;
|
||||||
|
@ -22,5 +23,6 @@ namespace Ombi.Core.Engine.Interfaces
|
||||||
Task<int> GetTotal();
|
Task<int> GetTotal();
|
||||||
Task UnSubscribeRequest(int requestId, RequestType type);
|
Task UnSubscribeRequest(int requestId, RequestType type);
|
||||||
Task SubscribeToRequest(int requestId, RequestType type);
|
Task SubscribeToRequest(int requestId, RequestType type);
|
||||||
|
Task<RequestQuotaCountModel> GetRemainingRequests();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -19,6 +19,7 @@ using Ombi.Core.Settings;
|
||||||
using Ombi.Settings.Settings.Models;
|
using Ombi.Settings.Settings.Models;
|
||||||
using Ombi.Store.Entities.Requests;
|
using Ombi.Store.Entities.Requests;
|
||||||
using Ombi.Store.Repository;
|
using Ombi.Store.Repository;
|
||||||
|
using Ombi.Core.Models;
|
||||||
|
|
||||||
namespace Ombi.Core.Engine
|
namespace Ombi.Core.Engine
|
||||||
{
|
{
|
||||||
|
@ -483,5 +484,13 @@ namespace Ombi.Core.Engine
|
||||||
|
|
||||||
return new RequestEngineResult {Result = true, Message = $"{movieName} has been successfully added!"};
|
return new RequestEngineResult {Result = true, Message = $"{movieName} has been successfully added!"};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<RequestQuotaCountModel> GetRemainingRequests()
|
||||||
|
{
|
||||||
|
return new RequestQuotaCountModel()
|
||||||
|
{
|
||||||
|
HasLimit = false,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -23,6 +23,7 @@ using Ombi.Core.Settings;
|
||||||
using Ombi.Settings.Settings.Models;
|
using Ombi.Settings.Settings.Models;
|
||||||
using Ombi.Store.Entities.Requests;
|
using Ombi.Store.Entities.Requests;
|
||||||
using Ombi.Store.Repository;
|
using Ombi.Store.Repository;
|
||||||
|
using Ombi.Core.Models;
|
||||||
|
|
||||||
namespace Ombi.Core.Engine
|
namespace Ombi.Core.Engine
|
||||||
{
|
{
|
||||||
|
@ -612,5 +613,13 @@ namespace Ombi.Core.Engine
|
||||||
|
|
||||||
return new RequestEngineResult { Result = true };
|
return new RequestEngineResult { Result = true };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<RequestQuotaCountModel> GetRemainingRequests()
|
||||||
|
{
|
||||||
|
return new RequestQuotaCountModel()
|
||||||
|
{
|
||||||
|
HasLimit = false,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
11
src/Ombi.Core/Models/RequestQuotaCountModel.cs
Normal file
11
src/Ombi.Core/Models/RequestQuotaCountModel.cs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
namespace Ombi.Core.Models
|
||||||
|
{
|
||||||
|
public class RequestQuotaCountModel
|
||||||
|
{
|
||||||
|
public bool HasLimit { get; set; }
|
||||||
|
|
||||||
|
public int Limit { get; set; }
|
||||||
|
|
||||||
|
public int Remaining { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ using Microsoft.Extensions.Logging;
|
||||||
using Ombi.Core;
|
using Ombi.Core;
|
||||||
using Ombi.Core.Engine;
|
using Ombi.Core.Engine;
|
||||||
using Ombi.Core.Engine.Interfaces;
|
using Ombi.Core.Engine.Interfaces;
|
||||||
|
using Ombi.Core.Models;
|
||||||
using Ombi.Core.Models.Search;
|
using Ombi.Core.Models.Search;
|
||||||
using StackExchange.Profiling;
|
using StackExchange.Profiling;
|
||||||
|
|
||||||
|
@ -182,5 +183,17 @@ namespace Ombi.Controllers
|
||||||
{
|
{
|
||||||
return await TvEngine.Trending();
|
return await TvEngine.Trending();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet("movie/requestCount")]
|
||||||
|
public async Task<RequestQuotaCountModel> RemainingMovieRequests()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("tv/requestCount")]
|
||||||
|
public async Task<RequestQuotaCountModel> RemainingTvRequests()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue