Merge pull request #902 from tidusjar/EAP

2.0 Release
pull/938/head v2.0
Jamie 8 years ago committed by GitHub
commit a1cc3b6690

@ -1,7 +1,7 @@
language: csharp
solution: PlexRequests.sln
solution: Ombi.sln
install:
- mono Tools/nuget.exe restore PlexRequests.sln
- mono Tools/nuget.exe restore Ombi.sln
- nuget install NUnit.Runners -OutputDirectory testrunner
script:
- xbuild /p:Configuration=Release PlexRequests.sln /p:TargetFrameworkVersion="v4.5"
- xbuild /p:Configuration=Release Ombi.sln /p:TargetFrameworkVersion="v4.5"

@ -24,11 +24,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System;
using RestSharp;
namespace PlexRequests.Api.Interfaces
namespace Ombi.Api.Interfaces
{
public interface IApiRequest
{

@ -26,10 +26,9 @@
#endregion
using System;
using Ombi.Api.Models.Movie;
using PlexRequests.Api.Models.Movie;
namespace PlexRequests.Api.Interfaces
namespace Ombi.Api.Interfaces
{
public interface ICouchPotatoApi
{

@ -24,13 +24,13 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Ombi.Api.Models.Music;
using PlexRequests.Api.Models.Music;
namespace PlexRequests.Api.Interfaces
namespace Ombi.Api.Interfaces
{
public interface IHeadphonesApi
{

@ -24,9 +24,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using PlexRequests.Api.Models.Music;
namespace PlexRequests.Api.Interfaces
using Ombi.Api.Models.Music;
namespace Ombi.Api.Interfaces
{
public interface IMusicBrainzApi
{

@ -24,11 +24,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using PlexRequests.Api.Models.Plex;
using System;
using Ombi.Api.Models.Plex;
namespace PlexRequests.Api.Interfaces
namespace Ombi.Api.Interfaces
{
public interface IPlexApi
{

@ -24,11 +24,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Threading.Tasks;
using PlexRequests.Api.Models.Notifications;
using System.Threading.Tasks;
using Ombi.Api.Models.Notifications;
namespace PlexRequests.Api.Interfaces
namespace Ombi.Api.Interfaces
{
public interface IPushbulletApi
{

@ -24,11 +24,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Threading.Tasks;
using PlexRequests.Api.Models.Notifications;
using System.Threading.Tasks;
using Ombi.Api.Models.Notifications;
namespace PlexRequests.Api.Interfaces
namespace Ombi.Api.Interfaces
{
public interface IPushoverApi
{

@ -27,9 +27,9 @@
using System;
using System.Threading.Tasks;
using PlexRequests.Api.Models.SickRage;
using Ombi.Api.Models.SickRage;
namespace PlexRequests.Api.Interfaces
namespace Ombi.Api.Interfaces
{
public interface ISickRageApi
{

@ -24,11 +24,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Threading.Tasks;
using PlexRequests.Api.Models.Notifications;
using System.Threading.Tasks;
using Ombi.Api.Models.Notifications;
namespace PlexRequests.Api.Interfaces
namespace Ombi.Api.Interfaces
{
public interface ISlackApi
{

@ -24,12 +24,12 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using Ombi.Api.Models.Sonarr;
using PlexRequests.Api.Models.Sonarr;
namespace PlexRequests.Api.Interfaces
namespace Ombi.Api.Interfaces
{
public interface ISonarrApi
{

@ -1,7 +1,7 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: WebDriverSetup.cs
// File: IWatcherApi.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
@ -24,30 +24,18 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System;
using System.Collections.Generic;
using Ombi.Api.Models.Watcher;
namespace PlexRequests.Automation
namespace Ombi.Api.Interfaces
{
public static class WebDriverSetup
public interface IWatcherApi
{
private static IWebDriver _webDriver;
public static IWebDriver SetUp(string url)
{
var driverService = FirefoxDriverService.CreateDefaultService("C:\\Tools\\WebDriver");
driverService.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
driverService.HideCommandPromptWindow = true;
driverService.SuppressInitialDiagnosticInformation = true;
_webDriver = new FirefoxDriver(driverService, new FirefoxOptions(), TimeSpan.FromSeconds(60));
_webDriver.Navigate().GoToUrl(url);
_webDriver.Manage().Timeouts().SetPageLoadTimeout(TimeSpan.FromMinutes(1));
_webDriver.Manage().Window.Maximize();
return _webDriver;
}
WatcherAddMovieResult AddMovie(string imdbId, string apiKey, Uri baseUrl);
WatcherListStatusResultContainer ListMovies(string apiKey, Uri baseUrl);
WatcherListStatusResultContainer ListMovies(string apiKey, Uri baseUrl, string imdbId);
WatcherVersion Version(string apiKey, Uri baseUri);
}
}

@ -7,8 +7,8 @@
<ProjectGuid>{95834072-A675-415D-AA8F-877C91623810}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PlexRequests.Api.Interfaces</RootNamespace>
<AssemblyName>PlexRequests.Api.Interfaces</AssemblyName>
<RootNamespace>Ombi.Api.Interfaces</RootNamespace>
<AssemblyName>Ombi.Api.Interfaces</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
@ -55,12 +55,13 @@
<Compile Include="IPushoverApi.cs" />
<Compile Include="ISickRageApi.cs" />
<Compile Include="ISonarrApi.cs" />
<Compile Include="IWatcherApi.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PlexRequests.Api.Models\PlexRequests.Api.Models.csproj">
<ProjectReference Include="..\Ombi.Api.Models\Ombi.Api.Models.csproj">
<Project>{CB37A5F8-6DFC-4554-99D3-A42B502E4591}</Project>
<Name>PlexRequests.Api.Models</Name>
<Name>Ombi.Api.Models</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>

@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PlexRequests.Api.Interfaces")]
[assembly: AssemblyTitle("Ombi.Api.Interfaces")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PlexRequests.Api.Interfaces")]
[assembly: AssemblyProduct("Ombi.Api.Interfaces")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

@ -24,9 +24,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Movie
namespace Ombi.Api.Models.Movie
{
public class CouchPotatoAdd
{

@ -24,9 +24,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using Newtonsoft.Json;
namespace PlexRequests.Api.Models.Movie
namespace Ombi.Api.Models.Movie
{
public class CouchPotatoApiKey
{

@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Movie
namespace Ombi.Api.Models.Movie
{
public class CouchPotatoMovies
{

@ -26,11 +26,9 @@
#endregion
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace PlexRequests.Api.Models.Movie
namespace Ombi.Api.Models.Movie
{
public class ProfileList
{

@ -0,0 +1,7 @@
namespace Ombi.Api.Models.Movie
{
public class CouchPotatoStatus
{
public bool success { get; set; }
}
}

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Music
namespace Ombi.Api.Models.Music
{
public class HeadphonesAlbumSearchResult
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Music
namespace Ombi.Api.Models.Music
{
public class HeadphonesArtistSearchResult
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Music
namespace Ombi.Api.Models.Music
{
public class HeadphonesGetIndex
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Music
namespace Ombi.Api.Models.Music
{
public class HeadphonesVersion
{

@ -24,9 +24,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Music
namespace Ombi.Api.Models.Music
{
public class Thumbnails
{

@ -24,11 +24,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace PlexRequests.Api.Models.Music
namespace Ombi.Api.Models.Music
{
public class CoverArtArchive
{

@ -24,11 +24,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace PlexRequests.Api.Models.Music
namespace Ombi.Api.Models.Music
{
public class TextRepresentation
{

@ -24,9 +24,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using Newtonsoft.Json;
namespace PlexRequests.Api.Models.Notifications
namespace Ombi.Api.Models.Notifications
{
public class PushbulletPush
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Notifications
namespace Ombi.Api.Models.Notifications
{
public class PushbulletResponse
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Notifications
namespace Ombi.Api.Models.Notifications
{
public class PushoverResponse
{

@ -24,16 +24,17 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using Newtonsoft.Json;
namespace PlexRequests.Api.Models.Notifications
namespace Ombi.Api.Models.Notifications
{
public class SlackNotificationBody
{
[JsonConstructor]
public SlackNotificationBody()
{
username = "Plex Requests";
username = "Ombi";
}
[JsonIgnore]

@ -7,8 +7,8 @@
<ProjectGuid>{CB37A5F8-6DFC-4554-99D3-A42B502E4591}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PlexRequests.Api.Models</RootNamespace>
<AssemblyName>PlexRequests.Api.Models</AssemblyName>
<RootNamespace>Ombi.Api.Models</RootNamespace>
<AssemblyName>Ombi.Api.Models</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
@ -35,6 +35,10 @@
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.105.2.3\lib\net45\RestSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@ -102,6 +106,9 @@
<Compile Include="Tv\TvSearchResult.cs" />
<Compile Include="Tv\TvShow.cs" />
<Compile Include="Tv\TvShowImages.cs" />
<Compile Include="Watcher\WatcherAddMovieResult.cs" />
<Compile Include="Watcher\WatcherListStatusResult.cs" />
<Compile Include="Watcher\WatcherVersion.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
@ -110,9 +117,9 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PlexRequests.Helpers\PlexRequests.Helpers.csproj">
<ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj">
<Project>{1252336D-42A3-482A-804C-836E60173DFA}</Project>
<Name>PlexRequests.Helpers</Name>
<Name>Ombi.Helpers</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

@ -1,6 +1,6 @@
using System.Xml.Serialization;
namespace PlexRequests.Api.Models.Plex
namespace Ombi.Api.Models.Plex
{
[XmlRoot(ElementName = "user")]
public class PlexAccount

@ -27,7 +27,7 @@
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Plex
namespace Ombi.Api.Models.Plex
{
public class PlexAuthentication
{

@ -24,11 +24,12 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Plex
{
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace Ombi.Api.Models.Plex
{
[XmlRoot(ElementName = "MediaContainer")]
public class PlexEpisodeMetadata
{

@ -27,7 +27,7 @@
using System.Xml.Serialization;
namespace PlexRequests.Api.Models.Plex
namespace Ombi.Api.Models.Plex
{
[XmlRoot(ElementName = "errors")]
public class PlexError

@ -27,7 +27,7 @@
using System.Xml.Serialization;
namespace PlexRequests.Api.Models.Plex
namespace Ombi.Api.Models.Plex
{
[XmlRoot(ElementName = "Server")]
public class Server

@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Xml.Serialization;
namespace PlexRequests.Api.Models.Plex
namespace Ombi.Api.Models.Plex
{
[XmlRoot(ElementName = "MediaContainer")]
public class PlexLibraries

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Services
namespace Ombi.Api.Models.Plex
{
public enum PlexMediaType
{

@ -28,7 +28,7 @@
using System.Collections.Generic;
using System.Xml.Serialization;
namespace PlexRequests.Api.Models.Plex
namespace Ombi.Api.Models.Plex
{
[XmlRoot(ElementName = "MediaContainer")]
public class PlexMetadata

@ -24,10 +24,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;
using System.Xml.Serialization;
namespace PlexRequests.Api.Models.Plex
namespace Ombi.Api.Models.Plex
{
[XmlRoot(ElementName = "Part")]
public class Part

@ -24,10 +24,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;
using System.Xml.Serialization;
namespace PlexRequests.Api.Models.Plex
namespace Ombi.Api.Models.Plex
{
[XmlRoot(ElementName = "Server")]
public class ServerInfo

@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace PlexRequests.Api.Models.Plex
namespace Ombi.Api.Models.Plex
{
[XmlRoot(ElementName = "Directory")]
public class Directory

@ -25,7 +25,7 @@
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Plex
namespace Ombi.Api.Models.Plex
{
public class PlexUserRequest
{

@ -27,7 +27,7 @@
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Plex
namespace Ombi.Api.Models.Plex
{
public class RecentlyAddedChild
{

@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PlexRequests.Api.Models")]
[assembly: AssemblyTitle("Ombi.Api.Models")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PlexRequests.Api.Models")]
[assembly: AssemblyProduct("Ombi.Api.Models")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

@ -1,4 +1,4 @@
namespace PlexRequests.Api.Models.SickRage
namespace Ombi.Api.Models.SickRage
{
public abstract class SickRageBase<T>
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.SickRage
namespace Ombi.Api.Models.SickRage
{
public class SickRagePingData
{

@ -1,7 +1,7 @@
using Newtonsoft.Json;
using PlexRequests.Helpers;
using Ombi.Helpers;
namespace PlexRequests.Api.Models.SickRage
namespace Ombi.Api.Models.SickRage
{
public class SickRageSeasonList : SickRageBase<object>
{

@ -27,7 +27,7 @@
using System.Collections.Generic;
namespace PlexRequests.Api.Models.SickRage
namespace Ombi.Api.Models.SickRage
{
public class Cache
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.SickRage
namespace Ombi.Api.Models.SickRage
{
public static class SickRageStatus
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.SickRage
namespace Ombi.Api.Models.SickRage
{
public class SickRageTvAddData
{

@ -25,10 +25,9 @@
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
namespace PlexRequests.Api.Models.SickRage
namespace Ombi.Api.Models.SickRage
{
public class SickrageShows : SickRageBase<Dictionary<int, Item>>
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class SonarrAddEpisodeBody
{

@ -27,7 +27,7 @@
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class Body
{

@ -1,9 +1,8 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using System;
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class Season
{

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class SonarrAllSeries
{

@ -25,7 +25,7 @@
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class Revision

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class SonarrEpisodes
{

@ -25,10 +25,7 @@
// ************************************************************************/
#endregion
using System.Collections.Generic;
using Newtonsoft.Json;
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class SonarrError
{

@ -27,7 +27,7 @@
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class Cutoff
{

@ -25,9 +25,7 @@
// ************************************************************************/
#endregion
using System.Xml.Linq;
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class SonarrSearchCommand
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class SeasonBody
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class SeriesBody
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Sonarr
namespace Ombi.Api.Models.Sonarr
{
public class SystemStatus
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Tv
namespace Ombi.Api.Models.Tv
{
public class Authentication
{

@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Tv
namespace Ombi.Api.Models.Tv
{
public class TvMazeShow
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Tv
namespace Ombi.Api.Models.Tv
{
public class TvMazeEpisodes
{

@ -24,9 +24,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Tv
namespace Ombi.Api.Models.Tv
{
public class Schedule
{

@ -0,0 +1,7 @@
namespace Ombi.Api.Models.Tv
{
public class TvMazeSeasons : TvMazeShow
{
public int number { get; set; }
}
}

@ -24,9 +24,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Tv
namespace Ombi.Api.Models.Tv
{
public class TvShowSearchResult
{

@ -24,9 +24,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Tv
namespace Ombi.Api.Models.Tv
{
public class TvShow
{

@ -27,7 +27,7 @@
using System.Collections.Generic;
namespace PlexRequests.Api.Models.Tv
namespace Ombi.Api.Models.Tv
{
public class RatingsInfo
{

@ -1,7 +1,7 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: BasePage.cs
// File: WatcherAddMovieResult.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
@ -24,15 +24,19 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;
namespace PlexRequests.Automation.Pages
using Newtonsoft.Json;
namespace Ombi.Api.Models.Watcher
{
public class BasePage
public class WatcherAddMovieResult
{
[FindsBy(How = How.XPath, Using = "/html/body/div[5]")]
public IWebElement Notificaiton { get; set; }
protected IWebDriver WebDriver { get; set; }
public bool response { get; set; }
public string message { get; set; }
[JsonIgnore]
public string ErrorMessage { get; set; }
[JsonIgnore]
public bool Error { get; set; }
}
}

@ -0,0 +1,90 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: WatcherListStatusResult.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;
using Newtonsoft.Json;
using RestSharp.Deserializers;
namespace Ombi.Api.Models.Watcher
{
public class Quality2
{
[JsonProperty("720P")]
public List<string> Q720P { get; set; }
[JsonProperty("1080P")]
public List<string> Q1080P { get; set; }
[JsonProperty("4K")]
public List<string> Q4K { get; set; }
public List<string> SD { get; set; }
}
public class Filters
{
public string preferredwords { get; set; }
public string ignoredwords { get; set; }
public string requiredwords { get; set; }
}
public class Quality
{
[JsonProperty("Quality")]
public Quality2 quality { get; set; }
public Filters Filters { get; set; }
}
public class WatcherListStatusResult
{
public string status { get; set; }
public string plot { get; set; }
public string rated { get; set; }
public string title { get; set; }
public object finishedscore { get; set; }
public string predb { get; set; }
public string year { get; set; }
public string poster { get; set; }
public string tomatourl { get; set; }
public string released { get; set; }
public object finisheddate { get; set; }
public string dvd { get; set; }
public string tomatorating { get; set; }
public string imdbid { get; set; }
public Quality quality { get; set; }
}
public class WatcherListStatusResultContainer
{
[JsonProperty("movies")]
public List<WatcherListStatusResult> Movies { get; set; }
[JsonProperty("response")]
public bool Response { get; set; }
[JsonIgnore]
public string ErrorMessage { get; set; }
[JsonIgnore]
public bool Error { get; set; }
}
}

@ -0,0 +1,8 @@
using System;
namespace Ombi.Api.Models
{
public class WatcherResponse<T>
{
}
}

@ -0,0 +1,35 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2017 Jamie Rees
// File: WatcherVersion.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.Api.Models.Watcher
{
public class WatcherVersion
{
public string version { get; set; }
public bool response { get; set; }
public string ErrorMessage { get; set; }
}
}

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="RestSharp" version="105.2.3" targetFramework="net45" />
</packages>

@ -24,20 +24,17 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.IO;
using System.Xml.Serialization;
using Newtonsoft.Json;
using NLog;
using PlexRequests.Api.Interfaces;
using PlexRequests.Helpers.Exceptions;
using Ombi.Api.Interfaces;
using Ombi.Helpers.Exceptions;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class ApiRequest : IApiRequest
{

@ -24,19 +24,16 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System;
using Newtonsoft.Json.Linq;
using NLog;
using PlexRequests.Api.Interfaces;
using PlexRequests.Api.Models.Movie;
using PlexRequests.Helpers;
using PlexRequests.Helpers.Exceptions;
using Ombi.Api.Interfaces;
using Ombi.Api.Models.Movie;
using Ombi.Helpers;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class CouchPotatoApi : ICouchPotatoApi
{

@ -24,21 +24,18 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Newtonsoft.Json;
using NLog;
using PlexRequests.Api.Interfaces;
using PlexRequests.Api.Models.Music;
using PlexRequests.Helpers;
using Ombi.Api.Interfaces;
using Ombi.Api.Models.Music;
using Ombi.Helpers;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class HeadphonesApi : IHeadphonesApi
{

@ -24,9 +24,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using PlexRequests.Helpers;
namespace PlexRequests.Api
using Ombi.Helpers;
namespace Ombi.Api
{
public abstract class MovieBase
{

@ -24,18 +24,15 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System;
using Newtonsoft.Json;
using NLog;
using PlexRequests.Api.Interfaces;
using PlexRequests.Api.Models.Music;
using Ombi.Api.Interfaces;
using Ombi.Api.Models.Music;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class MusicBrainzApi : IMusicBrainzApi
{

@ -7,8 +7,8 @@
<ProjectGuid>{8CB8D235-2674-442D-9C6A-35FCAEEB160D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PlexRequests.Api</RootNamespace>
<AssemblyName>PlexRequests.Api</AssemblyName>
<RootNamespace>Ombi.Api</RootNamespace>
<AssemblyName>Ombi.Api</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
@ -69,6 +69,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="ApiRequest.cs" />
<Compile Include="WatcherApi.cs" />
<Compile Include="MusicBrainzApi.cs" />
<Compile Include="SlackApi.cs" />
<Compile Include="PushoverApi.cs" />
@ -92,17 +93,17 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PlexRequests.Api.Interfaces\PlexRequests.Api.Interfaces.csproj">
<ProjectReference Include="..\Ombi.Api.Interfaces\Ombi.Api.Interfaces.csproj">
<Project>{95834072-A675-415D-AA8F-877C91623810}</Project>
<Name>PlexRequests.Api.Interfaces</Name>
<Name>Ombi.Api.Interfaces</Name>
</ProjectReference>
<ProjectReference Include="..\PlexRequests.Api.Models\PlexRequests.Api.Models.csproj">
<ProjectReference Include="..\Ombi.Api.Models\Ombi.Api.Models.csproj">
<Project>{CB37A5F8-6DFC-4554-99D3-A42B502E4591}</Project>
<Name>PlexRequests.Api.Models</Name>
<Name>Ombi.Api.Models</Name>
</ProjectReference>
<ProjectReference Include="..\PlexRequests.Helpers\PlexRequests.Helpers.csproj">
<ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj">
<Project>{1252336D-42A3-482A-804C-836E60173DFA}</Project>
<Name>PlexRequests.Helpers</Name>
<Name>Ombi.Helpers</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

@ -23,21 +23,18 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
using Polly;
#endregion
using System;
using System;
using NLog;
using PlexRequests.Api.Interfaces;
using PlexRequests.Api.Models.Plex;
using PlexRequests.Helpers;
using Ombi.Api.Interfaces;
using Ombi.Api.Models.Plex;
using Ombi.Helpers;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class PlexApi : IPlexApi
{
@ -420,8 +417,8 @@ namespace PlexRequests.Api
private void AddHeaders(ref RestRequest request, bool json)
{
request.AddHeader("X-Plex-Client-Identifier", $"PlexRequests.Net{Version}");
request.AddHeader("X-Plex-Product", "Plex Requests .Net");
request.AddHeader("X-Plex-Client-Identifier", $"Ombi{Version}");
request.AddHeader("X-Plex-Product", "Ombi");
request.AddHeader("X-Plex-Version", Version);
request.AddHeader("Content-Type", json ? "application/json" : "application/xml");
request.AddHeader("Accept", json ? "application/json" : "application/xml");

@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PlexRequests.Api")]
[assembly: AssemblyTitle("Ombi.Api")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PlexRequests.Api")]
[assembly: AssemblyProduct("Ombi.Api")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

@ -24,15 +24,14 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.Threading.Tasks;
using PlexRequests.Api.Interfaces;
using PlexRequests.Api.Models.Notifications;
using Ombi.Api.Interfaces;
using Ombi.Api.Models.Notifications;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class PushbulletApi : IPushbulletApi
{

@ -24,15 +24,14 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.Threading.Tasks;
using PlexRequests.Api.Interfaces;
using PlexRequests.Api.Models.Notifications;
using Ombi.Api.Interfaces;
using Ombi.Api.Models.Notifications;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class PushoverApi : IPushoverApi
{

@ -24,12 +24,12 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System;
using Polly;
using Polly.Retry;
namespace PlexRequests.Api
namespace Ombi.Api
{
public static class RetryHandler
{

@ -24,23 +24,20 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Linq;
using System;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using NLog;
using PlexRequests.Api.Interfaces;
using PlexRequests.Api.Models.SickRage;
using PlexRequests.Helpers;
using PlexRequests.Helpers.Exceptions;
using Ombi.Api.Interfaces;
using Ombi.Api.Models.SickRage;
using Ombi.Helpers;
using Ombi.Helpers.Exceptions;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class SickrageApi : ISickRageApi
{

@ -24,15 +24,14 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.Threading.Tasks;
using PlexRequests.Api.Interfaces;
using PlexRequests.Api.Models.Notifications;
using Ombi.Api.Interfaces;
using Ombi.Api.Models.Notifications;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class SlackApi : ISlackApi
{

@ -24,20 +24,18 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using NLog;
using PlexRequests.Api.Interfaces;
using PlexRequests.Api.Models.Sonarr;
using PlexRequests.Helpers;
using Ombi.Api.Interfaces;
using Ombi.Api.Models.Sonarr;
using Ombi.Helpers;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class SonarrApi : ISonarrApi
{

@ -24,17 +24,15 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using TMDbLib.Client;
using TMDbLib.Objects.General;
using TMDbLib.Objects.Movies;
using TMDbLib.Objects.Search;
using TMDbLib.Objects.TvShows;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class TheMovieDbApi : MovieBase
{

@ -24,13 +24,12 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using PlexRequests.Api.Models.Tv;
using System;
using Ombi.Api.Models.Tv;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
[Obsolete("Use TVMazeAPP")]
public class TheTvDbApi : TvBase

@ -24,11 +24,11 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using PlexRequests.Helpers;
using System;
using Ombi.Helpers;
namespace PlexRequests.Api
namespace Ombi.Api
{
public abstract class TvBase
{

@ -24,16 +24,15 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using NLog;
using PlexRequests.Api.Models.Tv;
using Ombi.Api.Models.Tv;
using RestSharp;
namespace PlexRequests.Api
namespace Ombi.Api
{
public class TvMazeApi : TvMazeBase
{

@ -24,7 +24,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api
namespace Ombi.Api
{
public class TvMazeBase
{

@ -0,0 +1,151 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: WatcherApi.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;
using System.Collections.Generic;
using Newtonsoft.Json;
using NLog;
using Ombi.Api.Interfaces;
using Ombi.Api.Models.Watcher;
using RestSharp;
namespace Ombi.Api
{
public class WatcherApi : IWatcherApi
{
public WatcherApi()
{
Api = new ApiRequest();
}
private ApiRequest Api { get; set; }
private static Logger Log = LogManager.GetCurrentClassLogger();
public WatcherAddMovieResult AddMovie(string imdbId, string apiKey, Uri baseUrl)
{
var response = Send("addmovie", apiKey, baseUrl, imdbId);
try
{
return JsonConvert.DeserializeObject<WatcherAddMovieResult>(response.Content);
}
catch (Exception e)
{
Log.Error(e);
return new WatcherAddMovieResult
{
Error = true,
ErrorMessage = e.Message
};
}
}
public WatcherVersion Version(string apiKey, Uri baseUri)
{
var response = Send("version", apiKey, baseUri);
try
{
return JsonConvert.DeserializeObject<WatcherVersion>(response.Content);
}
catch (Exception e)
{
Log.Error(e);
return new WatcherVersion
{
response = false,
ErrorMessage = e.Message
};
}
}
public WatcherListStatusResultContainer ListMovies(string apiKey, Uri baseUrl)
{
var response = Send("liststatus", apiKey, baseUrl);
try
{
if (response.Content.Contains("No movies found"))
{
return new WatcherListStatusResultContainer();
}
var items = JsonConvert.DeserializeObject<WatcherListStatusResultContainer>(response.Content);
return items;
}
catch (Exception e)
{
Log.Error(e);
return new WatcherListStatusResultContainer
{
Error = true,
ErrorMessage = e.Message
};
}
}
public WatcherListStatusResultContainer ListMovies(string apiKey, Uri baseUrl, string imdbId)
{
var response = Send("liststatus", apiKey, baseUrl, imdbId);
try
{
if (response.Content.Contains("No movies found"))
{
return new WatcherListStatusResultContainer();
}
return JsonConvert.DeserializeObject<WatcherListStatusResultContainer>(response.Content);
}
catch (Exception e)
{
Log.Error(e);
return new WatcherListStatusResultContainer
{
Error = true,
ErrorMessage = e.Message
};
}
}
private IRestResponse Send(string mode, string apiKey, Uri baseUrl, string imdbid = "")
{
RestRequest request;
request = new RestRequest
{
Resource = string.IsNullOrEmpty(imdbid) ? "/api?apikey={apikey}&mode={mode}" : "/api?apikey={apikey}&mode={mode}&imdbid={imdbid}"
};
request.AddUrlSegment("apikey", apiKey);
if (!string.IsNullOrEmpty(imdbid))
{
request.AddUrlSegment("imdbid", imdbid);
}
request.AddUrlSegment("mode", mode);
return Api.Execute(request, baseUrl);
}
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save