From c87451e93c7d805f63bc8ba70aa488aaafbb14b3 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Thu, 2 Mar 2017 09:53:09 +0000 Subject: [PATCH] Fixed #1195 --- Ombi.Api.Interfaces/IRadarrApi.cs | 2 +- Ombi.Api.Models/Ombi.Api.Models.csproj | 1 + .../Radarr/RadarrMovieContainer.cs | 41 +++++++++++++++++++ Ombi.Services/Jobs/RadarrCacher.cs | 2 +- 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 Ombi.Api.Models/Radarr/RadarrMovieContainer.cs diff --git a/Ombi.Api.Interfaces/IRadarrApi.cs b/Ombi.Api.Interfaces/IRadarrApi.cs index f1b015d31..fc20c8d43 100644 --- a/Ombi.Api.Interfaces/IRadarrApi.cs +++ b/Ombi.Api.Interfaces/IRadarrApi.cs @@ -8,7 +8,7 @@ namespace Ombi.Api.Interfaces public interface IRadarrApi { RadarrAddMovie AddMovie(int tmdbId, string title, int year, int qualityId, string rootPath, string apiKey, Uri baseUrl, bool searchNow = false); - List GetMovies(string apiKey, Uri baseUrl); + RadarrMovieContainer GetMovies(string apiKey, Uri baseUrl); List GetProfiles(string apiKey, Uri baseUrl); SystemStatus SystemStatus(string apiKey, Uri baseUrl); List GetRootFolders(string apiKey, Uri baseUrl); diff --git a/Ombi.Api.Models/Ombi.Api.Models.csproj b/Ombi.Api.Models/Ombi.Api.Models.csproj index eb3297999..addec5fa1 100644 --- a/Ombi.Api.Models/Ombi.Api.Models.csproj +++ b/Ombi.Api.Models/Ombi.Api.Models.csproj @@ -112,6 +112,7 @@ + diff --git a/Ombi.Api.Models/Radarr/RadarrMovieContainer.cs b/Ombi.Api.Models/Radarr/RadarrMovieContainer.cs new file mode 100644 index 000000000..fea472db7 --- /dev/null +++ b/Ombi.Api.Models/Radarr/RadarrMovieContainer.cs @@ -0,0 +1,41 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2017 Jamie Rees +// File: RadarrMovieContainer.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 + +using System.Collections.Generic; + +namespace Ombi.Api.Models.Radarr +{ + public class RadarrMovieContainer + { + public int page { get; set; } + public int pageSize { get; set; } + public string sortKey { get; set; } + public string sortDirection { get; set; } + public int totalRecords { get; set; } + public List records { get; set; } + } +} \ No newline at end of file diff --git a/Ombi.Services/Jobs/RadarrCacher.cs b/Ombi.Services/Jobs/RadarrCacher.cs index 0be1faa7b..e781c997f 100644 --- a/Ombi.Services/Jobs/RadarrCacher.cs +++ b/Ombi.Services/Jobs/RadarrCacher.cs @@ -67,7 +67,7 @@ namespace Ombi.Services.Jobs if (movies != null) { var movieIds = new List(); - foreach (var m in movies) + foreach (var m in movies.records) { if (m.tmdbId > 0) {