Improvements to the UI and also finished the availability checker #865 #1464

This commit is contained in:
Jamie.Rees 2017-08-25 14:06:47 +01:00
parent 385d206287
commit 3cc45b3022
30 changed files with 317 additions and 126 deletions

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
@ -16,11 +17,27 @@ namespace Ombi.Store.Repository.Requests
private IOmbiContext Db { get; }
public async Task<MovieRequests> GetRequest(int theMovieDbId)
public async Task<MovieRequests> GetRequestAsync(int theMovieDbId)
{
return await Db.MovieRequests.Where(x => x.TheMovieDbId == theMovieDbId)
try
{
return await Db.MovieRequests.Where(x => x.TheMovieDbId == theMovieDbId)
.Include(x => x.RequestedUser)
.FirstOrDefaultAsync();
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}
public MovieRequests GetRequest(int theMovieDbId)
{
return Db.MovieRequests.Where(x => x.TheMovieDbId == theMovieDbId)
.Include(x => x.RequestedUser)
.FirstOrDefaultAsync();
.FirstOrDefault();
}
public IQueryable<MovieRequests> Get()