Merge branch 'DotNetCore' of https://github.com/tidusjar/ombi into DotNetCore

This commit is contained in:
Jamie 2018-01-18 08:23:57 +00:00
commit 0fc2037ae3
26 changed files with 229 additions and 147 deletions

View file

@ -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);

View file

@ -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 =

View 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; }
}
}