mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 05:13:18 -07:00
Fixed the issue where movie requests were no longer being requested.
Changed the API for movie requests so we only need to pass the ID to approve/Deny TV Requests next #1601
This commit is contained in:
parent
b7b0381ce7
commit
7c5bca3b2b
17 changed files with 226 additions and 156 deletions
|
@ -4,14 +4,14 @@ using Ombi.Store.Entities.Requests;
|
|||
|
||||
namespace Ombi.Store.Repository
|
||||
{
|
||||
public interface IMovieRequestRepository
|
||||
public interface IMovieRequestRepository : IRepository<MovieRequests>
|
||||
{
|
||||
Task<MovieRequests> Add(MovieRequests request);
|
||||
Task Delete(MovieRequests request);
|
||||
IQueryable<MovieRequests> Get();
|
||||
Task<MovieRequests> GetRequestAsync(int theMovieDbId);
|
||||
MovieRequests GetRequest(int theMovieDbId);
|
||||
Task Update(MovieRequests request);
|
||||
Task Save();
|
||||
IQueryable<MovieRequests> GetWithUser();
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
@ -8,9 +7,9 @@ using Ombi.Store.Entities.Requests;
|
|||
|
||||
namespace Ombi.Store.Repository.Requests
|
||||
{
|
||||
public class MovieRequestRepository : IMovieRequestRepository
|
||||
public class MovieRequestRepository : Repository<MovieRequests>, IMovieRequestRepository
|
||||
{
|
||||
public MovieRequestRepository(IOmbiContext ctx)
|
||||
public MovieRequestRepository(IOmbiContext ctx) : base(ctx)
|
||||
{
|
||||
Db = ctx;
|
||||
}
|
||||
|
@ -40,20 +39,13 @@ namespace Ombi.Store.Repository.Requests
|
|||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
public IQueryable<MovieRequests> Get()
|
||||
public IQueryable<MovieRequests> GetWithUser()
|
||||
{
|
||||
return Db.MovieRequests
|
||||
.Include(x => x.RequestedUser)
|
||||
.AsQueryable();
|
||||
}
|
||||
|
||||
public async Task<MovieRequests> Add(MovieRequests request)
|
||||
{
|
||||
await Db.MovieRequests.AddAsync(request);
|
||||
await Db.SaveChangesAsync();
|
||||
return request;
|
||||
}
|
||||
|
||||
public async Task Delete(MovieRequests request)
|
||||
{
|
||||
Db.MovieRequests.Remove(request);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue