mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-13 18:16:55 -07:00
Moar !wip
This commit is contained in:
parent
eb89b352f4
commit
2f964f904e
8 changed files with 109 additions and 16 deletions
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Principal;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -15,7 +14,7 @@ using Ombi.Store.Repository;
|
|||
|
||||
namespace Ombi.Core.Engine
|
||||
{
|
||||
public class VoteEngine : BaseEngine
|
||||
public class VoteEngine : BaseEngine, IVoteEngine
|
||||
{
|
||||
public VoteEngine(IRepository<Votes> votes, IPrincipal user, OmbiUserManager um, IRuleEvaluator r, ISettingsService<VoteSettings> voteSettings,
|
||||
IMusicRequestEngine musicRequestEngine, ITvRequestEngine tvRequestEngine, IMovieRequestEngine movieRequestEngine) : base(user, um, r)
|
||||
|
@ -33,6 +32,16 @@ namespace Ombi.Core.Engine
|
|||
private readonly ITvRequestEngine _tvRequestEngine;
|
||||
private readonly IMovieRequestEngine _movieRequestEngine;
|
||||
|
||||
public async Task GetMovieViewModel()
|
||||
{
|
||||
var requests = await _movieRequestEngine.GetRequests();
|
||||
foreach (var r in requests)
|
||||
{
|
||||
// Make model
|
||||
var votes = GetVotes(r.Id, RequestType.Movie);
|
||||
}
|
||||
}
|
||||
|
||||
public IQueryable<Votes> GetVotes(int requestId, RequestType requestType)
|
||||
{
|
||||
return _voteRepository.GetAll().Where(x => x.RequestType == requestType && requestId == x.RequestId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue