mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 05:13:18 -07:00
Smal changes to the api
This commit is contained in:
parent
9f1475abb6
commit
98e99251f3
8 changed files with 46 additions and 12 deletions
|
@ -1,15 +1,13 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Ombi.Core.Models.Requests;
|
||||
using Ombi.Core.Models.Search;
|
||||
using Ombi.Store.Entities;
|
||||
using Ombi.Store.Entities.Requests;
|
||||
|
||||
namespace Ombi.Core.Engine.Interfaces
|
||||
{
|
||||
public interface IMovieRequestEngine : IRequestEngine<MovieRequests>
|
||||
{
|
||||
Task<RequestEngineResult> RequestMovie(SearchMovieViewModel model);
|
||||
Task<RequestEngineResult> RequestMovie(MovieRequestViewModel model);
|
||||
|
||||
Task<IEnumerable<MovieRequests>> SearchMovieRequest(string search);
|
||||
|
||||
|
|
|
@ -43,16 +43,16 @@ namespace Ombi.Core.Engine
|
|||
/// </summary>
|
||||
/// <param name="model">The model.</param>
|
||||
/// <returns></returns>
|
||||
public async Task<RequestEngineResult> RequestMovie(SearchMovieViewModel model)
|
||||
public async Task<RequestEngineResult> RequestMovie(MovieRequestViewModel model)
|
||||
{
|
||||
var movieInfo = await MovieApi.GetMovieInformation(model.Id);
|
||||
var movieInfo = await MovieApi.GetMovieInformation(model.TheMovieDbId);
|
||||
if (movieInfo == null || movieInfo.Id == 0)
|
||||
{
|
||||
return new RequestEngineResult
|
||||
{
|
||||
Result = false,
|
||||
Message = "There was an issue adding this movie!",
|
||||
ErrorMessage = $"TheMovieDb didn't have any information for ID {model.Id}"
|
||||
ErrorMessage = $"TheMovieDb didn't have any information for ID {model.TheMovieDbId}"
|
||||
};
|
||||
}
|
||||
var fullMovieName =
|
||||
|
|
33
src/Ombi.Core/Models/Requests/MovieRequestViewModel.cs
Normal file
33
src/Ombi.Core/Models/Requests/MovieRequestViewModel.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
#region Copyright
|
||||
// /************************************************************************
|
||||
// Copyright (c) 2018 Jamie Rees
|
||||
// File: MovieRequestViewModel.cs
|
||||
// Created By: Jamie Rees
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// ************************************************************************/
|
||||
#endregion
|
||||
namespace Ombi.Core.Models.Requests
|
||||
{
|
||||
public class MovieRequestViewModel
|
||||
{
|
||||
public int TheMovieDbId { get; set; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue