Skip to content

Commit

Permalink
Merge pull request #1025 from tidusjar/EAP
Browse files Browse the repository at this point in the history
Release 2.1
  • Loading branch information
tidusjar authored Jan 31, 2017
2 parents a76822c + 83f7f6a commit 2e8736d
Show file tree
Hide file tree
Showing 122 changed files with 4,106 additions and 550 deletions.
38 changes: 38 additions & 0 deletions Ombi.Api.Interfaces/IDiscordApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2017 Jamie Rees
// File: IDiscordApi.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.Threading.Tasks;
using Ombi.Api.Models.Notifications;

namespace Ombi.Api.Interfaces
{
public interface IDiscordApi
{
void SendMessage(string message, string webhookId, string webhookToken, string username = null);
Task SendMessageAsync(string message, string webhookId, string webhookToken, string username = null);
}
}
2 changes: 1 addition & 1 deletion Ombi.Api.Interfaces/INetflixApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ namespace Ombi.Api.Interfaces
{
public interface INetflixApi
{
NetflixMovieResult GetMovies(string movieName, string year = null);
NetflixMovieResult CheckNetflix(string title, string year = null);
}
}
15 changes: 15 additions & 0 deletions Ombi.Api.Interfaces/IRadarrApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using Ombi.Api.Models.Radarr;
using Ombi.Api.Models.Sonarr;

namespace Ombi.Api.Interfaces
{
public interface IRadarrApi
{
RadarrAddMovie AddMovie(int tmdbId, string title, int year, int qualityId, string rootPath, string apiKey, Uri baseUrl, bool searchNow = false);
List<RadarrMovieResponse> GetMovies(string apiKey, Uri baseUrl);
List<SonarrProfile> GetProfiles(string apiKey, Uri baseUrl);
SystemStatus SystemStatus(string apiKey, Uri baseUrl);
}
}
3 changes: 2 additions & 1 deletion Ombi.Api.Interfaces/ISonarrApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ SonarrAddSeries AddSeries(int tvdbId, string title, int qualityId, bool seasonFo
bool searchForMissingEpisodes = false);

SonarrAddSeries AddSeriesNew(int tvdbId, string title, int qualityId, bool seasonFolders, string rootPath,
int[] seasons, string apiKey, Uri baseUrl, bool monitor = true,
int[] seasons, string apiKey, Uri baseUrl, bool monitor = true,
bool searchForMissingEpisodes = false);

SystemStatus SystemStatus(string apiKey, Uri baseUrl);
List<SonarrRootFolder> GetRootFolders(string apiKey, Uri baseUrl);

List<Series> GetSeries(string apiKey, Uri baseUrl);
Series GetSeries(string seriesId, string apiKey, Uri baseUrl);
Expand Down
16 changes: 16 additions & 0 deletions Ombi.Api.Interfaces/ITraktApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using TraktApiSharp.Enums;
using TraktApiSharp.Objects.Get.Shows;
using TraktApiSharp.Objects.Get.Shows.Common;

namespace Ombi.Api.Interfaces
{
public interface ITraktApi
{
Task<IEnumerable<TraktMostAnticipatedShow>> GetAnticipatedShows(int? page = default(int?), int? limitPerPage = default(int?));
Task<IEnumerable<TraktMostWatchedShow>> GetMostWatchesShows(TraktTimePeriod period = null, int? page = default(int?), int? limitPerPage = default(int?));
Task<IEnumerable<TraktShow>> GetPopularShows(int? page = default(int?), int? limitPerPage = default(int?));
Task<IEnumerable<TraktTrendingShow>> GetTrendingShows(int? page = default(int?), int? limitPerPage = default(int?));
}
}
11 changes: 11 additions & 0 deletions Ombi.Api.Interfaces/Ombi.Api.Interfaces.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<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>
Expand All @@ -43,19 +47,26 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="TraktApiSharp, Version=0.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\TraktApiSharp.0.8.0\lib\portable-net45+netcore45+wpa81\TraktApiSharp.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="IApiRequest.cs" />
<Compile Include="ICouchPotatoApi.cs" />
<Compile Include="IDiscordApi.cs" />
<Compile Include="IHeadphonesApi.cs" />
<Compile Include="IMusicBrainzApi.cs" />
<Compile Include="INetflixApi.cs" />
<Compile Include="IPlexApi.cs" />
<Compile Include="IPushbulletApi.cs" />
<Compile Include="IRadarrApi.cs" />
<Compile Include="ISlackApi.cs" />
<Compile Include="IPushoverApi.cs" />
<Compile Include="ISickRageApi.cs" />
<Compile Include="ISonarrApi.cs" />
<Compile Include="ITraktApi.cs" />
<Compile Include="IWatcherApi.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions Ombi.Api.Interfaces/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?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" />
<package id="TraktApiSharp" version="0.8.0" targetFramework="net45" />
</packages>
104 changes: 104 additions & 0 deletions Ombi.Api.Models/Movie/TmdbMovieDetails.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2017 Jamie Rees
// File: TmdbMovieDetails.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion

using System.Collections.Generic;

namespace Ombi.Api.Models.Movie
{

public class Genre
{
public int id { get; set; }
public string name { get; set; }
}

public class ProductionCompany
{
public string name { get; set; }
public int id { get; set; }
}

public class ProductionCountry
{
public string iso_3166_1 { get; set; }
public string name { get; set; }
}

public class SpokenLanguage
{
public string iso_639_1 { get; set; }
public string name { get; set; }
}

public class Result
{
public string id { get; set; }
public string iso_639_1 { get; set; }
public string iso_3166_1 { get; set; }
public string key { get; set; }
public string name { get; set; }
public string site { get; set; }
public int size { get; set; }
public string type { get; set; }
}

public class Videos
{
public List<Result> results { get; set; }
}

public class TmdbMovieDetails
{
public bool adult { get; set; }
public string backdrop_path { get; set; }
public object belongs_to_collection { get; set; }
public int budget { get; set; }
public List<Genre> genres { get; set; }
public string homepage { get; set; }
public int id { get; set; }
public string imdb_id { get; set; }
public string original_language { get; set; }
public string original_title { get; set; }
public string overview { get; set; }
public double popularity { get; set; }
public string poster_path { get; set; }
public List<ProductionCompany> production_companies { get; set; }
public List<ProductionCountry> production_countries { get; set; }
public string release_date { get; set; }
public int revenue { get; set; }
public int runtime { get; set; }
public List<SpokenLanguage> spoken_languages { get; set; }
public string status { get; set; }
public string tagline { get; set; }
public string title { get; set; }
public bool video { get; set; }
public double vote_average { get; set; }
public int vote_count { get; set; }
public Videos videos { get; set; }
}

}
7 changes: 7 additions & 0 deletions Ombi.Api.Models/Netflix/NetflixMovieResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,12 @@ public class NetflixMovieResult
public string Mediatype { get; set; }
[JsonProperty(PropertyName = "runtime")]
public string Runtime { get; set; }


// For errors
[JsonProperty(PropertyName = "errorcode")]
public int ErrorCode { get; set; }
[JsonProperty(PropertyName = "message")]
public string Message { get; set; }
}
}
34 changes: 34 additions & 0 deletions Ombi.Api.Models/Notifications/DiscordWebhookRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2017 Jamie Rees
// File: DiscordWebhookRequest.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.Notifications
{
public class DiscordWebhookRequest
{
public string content { get; set; }
public string username { get; set; }
}
}
47 changes: 47 additions & 0 deletions Ombi.Api.Models/Notifications/DiscordWebhookResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2017 Jamie Rees
// File: DiscordWebhookResponse.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 Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace Ombi.Api.Models.Notifications
{
public class DiscordWebhookResponse
{
public string name { get; set; }
[JsonProperty(PropertyName = "channel_id")]
public string channelid { get; set; }

public string token { get; set; }
public string avatar { get; set; }
[JsonProperty(PropertyName = "guild_id")]
public string guildid { get; set; }

public string id { get; set; }

}
}
8 changes: 8 additions & 0 deletions Ombi.Api.Models/Ombi.Api.Models.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<Compile Include="Movie\CouchPotatoProfiles.cs" />
<Compile Include="Movie\CouchPotatoStatus.cs" />
<Compile Include="Movie\CouchPotatoApiKey.cs" />
<Compile Include="Movie\TmdbMovieDetails.cs" />
<Compile Include="Music\HeadphonesAlbumSearchResult.cs" />
<Compile Include="Music\HeadphonesArtistSearchResult.cs" />
<Compile Include="Music\HeadphonesGetIndex.cs" />
Expand All @@ -62,6 +63,8 @@
<Compile Include="Music\MusicBrainzReleaseInfo.cs" />
<Compile Include="Music\MusicBrainzSearchResults.cs" />
<Compile Include="Netflix\NetflixMovieResult.cs" />
<Compile Include="Notifications\DiscordWebhookRequest.cs" />
<Compile Include="Notifications\DiscordWebhookResponse.cs" />
<Compile Include="Notifications\PushbulletPush.cs" />
<Compile Include="Notifications\PushbulletResponse.cs" />
<Compile Include="Notifications\PushoverResponse.cs" />
Expand All @@ -80,6 +83,10 @@
<Compile Include="Plex\PlexUserRequest.cs" />
<Compile Include="Plex\RecentlyAddedModelOld.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Radarr\RadarrAddMovie.cs" />
<Compile Include="Radarr\RadarrAddOptions.cs" />
<Compile Include="Radarr\RadarrError.cs" />
<Compile Include="Radarr\RadarrMovieResponse.cs" />
<Compile Include="SickRage\SickRageBase.cs" />
<Compile Include="SickRage\SickrageShows.cs" />
<Compile Include="SickRage\SickRagePing.cs" />
Expand All @@ -95,6 +102,7 @@
<Compile Include="Sonarr\SonarrEpisodes.cs" />
<Compile Include="Sonarr\SonarrError.cs" />
<Compile Include="Sonarr\SonarrProfile.cs" />
<Compile Include="Sonarr\SonarrRootFolder.cs" />
<Compile Include="Sonarr\SonarrSearchCommand.cs" />
<Compile Include="Sonarr\SonarrSeasonSearchResult.cs" />
<Compile Include="Sonarr\SonarrSeriesSearchResult.cs" />
Expand Down
Loading

0 comments on commit 2e8736d

Please sign in to comment.