Merge pull request #902 from tidusjar/EAP

2.0 Release
This commit is contained in:
Jamie 2017-01-14 20:59:18 +00:00 committed by GitHub
commit a1cc3b6690
667 changed files with 4569 additions and 3393 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -27,9 +27,9 @@
using System; using System;
using System.Threading.Tasks; 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 public interface ISickRageApi
{ {

View file

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

View file

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

View file

@ -1,7 +1,7 @@
#region Copyright #region Copyright
// /************************************************************************ // /************************************************************************
// Copyright (c) 2016 Jamie Rees // Copyright (c) 2016 Jamie Rees
// File: WebDriverSetup.cs // File: IWatcherApi.cs
// Created By: Jamie Rees // Created By: Jamie Rees
// //
// Permission is hereby granted, free of charge, to any person obtaining // 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. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/ // ************************************************************************/
#endregion #endregion
using System; using System;
using System.Collections.Generic;
using Ombi.Api.Models.Watcher;
using OpenQA.Selenium; namespace Ombi.Api.Interfaces
using OpenQA.Selenium.Firefox;
namespace PlexRequests.Automation
{ {
public interface IWatcherApi
public static class WebDriverSetup
{ {
private static IWebDriver _webDriver; WatcherAddMovieResult AddMovie(string imdbId, string apiKey, Uri baseUrl);
WatcherListStatusResultContainer ListMovies(string apiKey, Uri baseUrl);
public static IWebDriver SetUp(string url) WatcherListStatusResultContainer ListMovies(string apiKey, Uri baseUrl, string imdbId);
{ WatcherVersion Version(string apiKey, Uri baseUri);
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;
}
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -24,11 +24,12 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/ // ************************************************************************/
#endregion #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")] [XmlRoot(ElementName = "MediaContainer")]
public class PlexEpisodeMetadata public class PlexEpisodeMetadata
{ {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
#region Copyright #region Copyright
// /************************************************************************ // /************************************************************************
// Copyright (c) 2016 Jamie Rees // Copyright (c) 2016 Jamie Rees
// File: BasePage.cs // File: WatcherAddMovieResult.cs
// Created By: Jamie Rees // Created By: Jamie Rees
// //
// Permission is hereby granted, free of charge, to any person obtaining // 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. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/ // ************************************************************************/
#endregion #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 bool response { get; set; }
public IWebElement Notificaiton { get; set; } public string message { get; set; }
protected IWebDriver WebDriver { get; set; }
[JsonIgnore]
public string ErrorMessage { get; set; }
[JsonIgnore]
public bool Error { get; set; }
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

151
Ombi.Api/WatcherApi.cs Normal file
View file

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