diff --git a/.gitignore b/.gitignore index 3cc952b53..caef0e940 100644 --- a/.gitignore +++ b/.gitignore @@ -236,3 +236,4 @@ _Pvt_Extensions .fake/ *.ncrunchproject *.ncrunchsolution + diff --git a/PlexRequestes.Automation.Helpers/DatabaseConfiguration.cs b/PlexRequestes.Automation.Helpers/DatabaseConfiguration.cs new file mode 100644 index 000000000..c72b27e43 --- /dev/null +++ b/PlexRequestes.Automation.Helpers/DatabaseConfiguration.cs @@ -0,0 +1,81 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: DatabaseConfiguration.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 Mono.Data.Sqlite; + +using PlexRequests.Core; +using PlexRequests.Core.SettingModels; +using PlexRequests.Helpers; +using PlexRequests.Store; +using PlexRequests.Store.Repository; + +namespace PlexRequestes.Automation.Helpers +{ + public static class DatabaseConfiguration + { + private static SettingsJsonRepository _jsonRepository = new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider()); + + public static void ResetDatabase() + { + var defaultSettings = new PlexRequestSettings + { + RequireTvShowApproval = true, + RequireMovieApproval = true, + SearchForMovies = true, + SearchForTvShows = true, + BaseUrl = string.Empty, + CollectAnalyticData = true, + }; + UpdateSettings(defaultSettings); + + LandingPageSettings lp = null; + PlexSettings plexSettings = null; + SonarrSettings sonarr = null; + CouchPotatoSettings cp = null; + SickRageSettings sr = null; + UpdateSettings(lp); + UpdateSettings(plexSettings); + UpdateSettings(sonarr); + UpdateSettings(cp); + UpdateSettings(sr); + + + } + + + public static void UpdateSettings(T settings) where T : Settings, new() + { + var service = new SettingsServiceV2(_jsonRepository); + if (settings == null) + { + var existing = service.GetSettings(); + service.Delete(existing); + return; + } + service.SaveSettings(settings); + } + } +} \ No newline at end of file diff --git a/PlexRequestes.Automation.Helpers/DriverHelpers.cs b/PlexRequestes.Automation.Helpers/DriverHelpers.cs new file mode 100644 index 000000000..ca2564473 --- /dev/null +++ b/PlexRequestes.Automation.Helpers/DriverHelpers.cs @@ -0,0 +1,77 @@ +using System; + +using OpenQA.Selenium; + +namespace PlexRequestes.Automation.Helpers +{ + public static class DriverHelpers + { + public static bool Exists(this IWebElement element, bool preformAStringEmptyCheck) + { + try + { + var text = element.Text; + if (preformAStringEmptyCheck) + { + if (string.IsNullOrEmpty(text)) + { + return false; + } + } + } + catch (NoSuchElementException) + { + return false; + } + + return true; + } + + public static bool Exists(this IWebDriver driver, By locator, bool preformAStringEmptyCheck) + { + try + { + var element = driver.FindElement(locator); + var text = element.Text; + if (preformAStringEmptyCheck) + { + if (string.IsNullOrEmpty(text)) + { + return false; + } + } + } + catch (NoSuchElementException) + { + return false; + } + + return true; + } + + /// + /// The exists. + /// + /// The element. + /// + /// The . + /// + public static bool Exists(this IWebElement element) + { + try + { + var text = element.Text; + if (string.IsNullOrEmpty(text)) + { + return false; + } + } + catch (Exception) + { + return false; + } + + return true; + } + } +} diff --git a/PlexRequestes.Automation.Helpers/PlexRequestes.Automation.Helpers.csproj b/PlexRequestes.Automation.Helpers/PlexRequestes.Automation.Helpers.csproj new file mode 100644 index 000000000..388b6240e --- /dev/null +++ b/PlexRequestes.Automation.Helpers/PlexRequestes.Automation.Helpers.csproj @@ -0,0 +1,89 @@ + + + + + Debug + AnyCPU + {DC8BACEF-C284-4A8F-A9AA-7F49EFABA288} + Library + Properties + PlexRequestes.Automation.Helpers + PlexRequestes.Automation.Helpers + v4.5.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll + True + + + ..\Assemblies\Mono.Data.Sqlite.dll + + + + + + + + + + + + ..\packages\Selenium.WebDriver.2.53.1\lib\net40\WebDriver.dll + True + + + ..\packages\Selenium.Support.2.53.1\lib\net40\WebDriver.Support.dll + True + + + + + + + + + + + + + + {dd7dc444-d3bf-4027-8ab9-efc71f5ec581} + PlexRequests.Core + + + {1252336D-42A3-482A-804C-836E60173DFA} + PlexRequests.Helpers + + + {92433867-2b7b-477b-a566-96c382427525} + PlexRequests.Store + + + + + \ No newline at end of file diff --git a/PlexRequestes.Automation.Helpers/Properties/AssemblyInfo.cs b/PlexRequestes.Automation.Helpers/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..81cb11299 --- /dev/null +++ b/PlexRequestes.Automation.Helpers/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +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("PlexRequestes.Automation.Helpers")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PlexRequestes.Automation.Helpers")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("dc8bacef-c284-4a8f-a9aa-7f49efaba288")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PlexRequestes.Automation.Helpers/app.config b/PlexRequestes.Automation.Helpers/app.config new file mode 100644 index 000000000..8460dd432 --- /dev/null +++ b/PlexRequestes.Automation.Helpers/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/PlexRequestes.Automation.Helpers/packages.config b/PlexRequestes.Automation.Helpers/packages.config new file mode 100644 index 000000000..34b40b473 --- /dev/null +++ b/PlexRequestes.Automation.Helpers/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PlexRequests.Api.Interfaces/ICouchPotatoApi.cs b/PlexRequests.Api.Interfaces/ICouchPotatoApi.cs index 0e018e6a8..5d17f771d 100644 --- a/PlexRequests.Api.Interfaces/ICouchPotatoApi.cs +++ b/PlexRequests.Api.Interfaces/ICouchPotatoApi.cs @@ -1,41 +1,43 @@ -#region Copyright -// /************************************************************************ -// Copyright (c) 2016 Jamie Rees -// File: ICouchPotatoApi.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 PlexRequests.Api.Models.Movie; - -namespace PlexRequests.Api.Interfaces -{ - public interface ICouchPotatoApi - { - bool AddMovie(string imdbid, string apiKey, string title, Uri baseUrl, string profileID = default(string)); - CouchPotatoStatus GetStatus(Uri url, string apiKey); - CouchPotatoProfiles GetProfiles(Uri url, string apiKey); - CouchPotatoMovies GetMovies(Uri baseUrl, string apiKey, string[] status); - } +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: ICouchPotatoApi.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 PlexRequests.Api.Models.Movie; + +namespace PlexRequests.Api.Interfaces +{ + public interface ICouchPotatoApi + { + bool AddMovie(string imdbid, string apiKey, string title, Uri baseUrl, string profileID = default(string)); + CouchPotatoStatus GetStatus(Uri url, string apiKey); + CouchPotatoProfiles GetProfiles(Uri url, string apiKey); + CouchPotatoMovies GetMovies(Uri baseUrl, string apiKey, string[] status); + + CoucPotatoApiKey GetApiKey(Uri baseUrl, string username, string password); + } } \ No newline at end of file diff --git a/PlexRequests.Api.Interfaces/IPlexApi.cs b/PlexRequests.Api.Interfaces/IPlexApi.cs index 075628385..7bd6c8095 100644 --- a/PlexRequests.Api.Interfaces/IPlexApi.cs +++ b/PlexRequests.Api.Interfaces/IPlexApi.cs @@ -1,45 +1,48 @@ -#region Copyright -// /************************************************************************ -// Copyright (c) 2016 Jamie Rees -// File: IPlexApi.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 PlexRequests.Api.Models; -using PlexRequests.Api.Models.Plex; - -namespace PlexRequests.Api.Interfaces -{ - public interface IPlexApi - { - PlexAuthentication SignIn(string username, string password); - PlexFriends GetUsers(string authToken); - PlexSearch SearchContent(string authToken, string searchTerm, Uri plexFullHost); - PlexStatus GetStatus(string authToken, Uri uri); - PlexAccount GetAccount(string authToken); - PlexLibraries GetLibrarySections(string authToken, Uri plexFullHost); - PlexSearch GetLibrary(string authToken, Uri plexFullHost, string libraryId); - PlexMetadata GetMetadata(string authToken, Uri plexFullHost, string itemId); - } +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: IPlexApi.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 PlexRequests.Api.Models.Plex; + +namespace PlexRequests.Api.Interfaces +{ + public interface IPlexApi + { + PlexAuthentication SignIn(string username, string password); + PlexFriends GetUsers(string authToken); + PlexSearch SearchContent(string authToken, string searchTerm, Uri plexFullHost); + PlexStatus GetStatus(string authToken, Uri uri); + PlexAccount GetAccount(string authToken); + PlexLibraries GetLibrarySections(string authToken, Uri plexFullHost); + PlexSearch GetLibrary(string authToken, Uri plexFullHost, string libraryId); + PlexMetadata GetMetadata(string authToken, Uri plexFullHost, string itemId); + PlexEpisodeMetadata GetEpisodeMetaData(string authToken, Uri host, string ratingKey); + PlexSearch GetAllEpisodes(string authToken, Uri host, string section, int startPage, int returnCount); + PlexServer GetServer(string authToken); + PlexSeasonMetadata GetSeasons(string authToken, Uri plexFullHost, string ratingKey); + } } \ No newline at end of file diff --git a/PlexRequests.Api.Interfaces/ISonarrApi.cs b/PlexRequests.Api.Interfaces/ISonarrApi.cs index 7e888f91a..5c5594ad8 100644 --- a/PlexRequests.Api.Interfaces/ISonarrApi.cs +++ b/PlexRequests.Api.Interfaces/ISonarrApi.cs @@ -1,45 +1,52 @@ -#region Copyright -// /************************************************************************ -// Copyright (c) 2016 Jamie Rees -// File: ISonarrApi.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 PlexRequests.Api.Models.Sonarr; - -namespace PlexRequests.Api.Interfaces -{ - public interface ISonarrApi - { - List GetProfiles(string apiKey, Uri baseUrl); - - SonarrAddSeries AddSeries(int tvdbId, string title, int qualityId, bool seasonFolders, string rootPath, - int seasonCount, int[] seasons, string apiKey, Uri baseUrl); - - SystemStatus SystemStatus(string apiKey, Uri baseUrl); - - List GetSeries(string apiKey, Uri baseUrl); - } +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: ISonarrApi.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 PlexRequests.Api.Models.Sonarr; + +namespace PlexRequests.Api.Interfaces +{ + public interface ISonarrApi + { + List GetProfiles(string apiKey, Uri baseUrl); + + SonarrAddSeries AddSeries(int tvdbId, string title, int qualityId, bool seasonFolders, string rootPath, + int seasonCount, int[] seasons, string apiKey, Uri baseUrl, bool monitor = true, + bool searchForMissingEpisodes = false); + + SystemStatus SystemStatus(string apiKey, Uri baseUrl); + + List GetSeries(string apiKey, Uri baseUrl); + Series GetSeries(string seriesId, string apiKey, Uri baseUrl); + IEnumerable GetEpisodes(string seriesId, string apiKey, Uri baseUrl); + SonarrEpisode GetEpisode(string episodeId, string apiKey, Uri baseUrl); + SonarrEpisode UpdateEpisode(SonarrEpisode episodeInfo, string apiKey, Uri baseUrl); + SonarrAddEpisodeResult SearchForEpisodes(int[] episodeIds, string apiKey, Uri baseUrl); + Series UpdateSeries(Series series, string apiKey, Uri baseUrl); + } } \ No newline at end of file diff --git a/PlexRequests.Api.Models/Movie/CoucPotatoApiKey.cs b/PlexRequests.Api.Models/Movie/CoucPotatoApiKey.cs new file mode 100644 index 000000000..369d438c3 --- /dev/null +++ b/PlexRequests.Api.Models/Movie/CoucPotatoApiKey.cs @@ -0,0 +1,38 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: CoucPotatoApiKey.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; + +namespace PlexRequests.Api.Models.Movie +{ + public class CoucPotatoApiKey + { + [JsonProperty("success")] + public bool Result { get; set; } + [JsonProperty("api_key")] + public string ApiKey { get; set; } + } +} \ No newline at end of file diff --git a/PlexRequests.Api.Models/Movie/CouchPotatoAdd.cs b/PlexRequests.Api.Models/Movie/CouchPotatoAdd.cs index 21c222974..63b20df1e 100644 --- a/PlexRequests.Api.Models/Movie/CouchPotatoAdd.cs +++ b/PlexRequests.Api.Models/Movie/CouchPotatoAdd.cs @@ -1,71 +1,91 @@ -using System; +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: CouchPotatoAdd.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 System.Linq; -using System.Text; -using System.Threading.Tasks; namespace PlexRequests.Api.Models.Movie { - public class CouchPotatoAdd { public Movie movie { get; set; } public bool success { get; set; } } + public class Rating { public List imdb { get; set; } } - - public class Images { - public List disc_art { get; set; } - public List poster { get; set; } - public List backdrop { get; set; } - public List extra_thumbs { get; set; } - public List poster_original { get; set; } public List actors { get; set; } + public List backdrop { get; set; } public List backdrop_original { get; set; } - public List clear_art { get; set; } - public List logo { get; set; } public List banner { get; set; } - public List landscape { get; set; } + public List clear_art { get; set; } + public List disc_art { get; set; } public List extra_fanart { get; set; } + public List extra_thumbs { get; set; } + public List landscape { get; set; } + public List logo { get; set; } + public List poster { get; set; } + public List poster_original { get; set; } } public class Info { - public Rating rating { get; set; } - public List genres { get; set; } - public int tmdb_id { get; set; } - public string plot { get; set; } - public string tagline { get; set; } - public Release_Date release_date { get; set; } - public int year { get; set; } - public string original_title { get; set; } public List actor_roles { get; set; } - public bool via_imdb { get; set; } - public Images images { get; set; } + public List actors { get; set; } public List directors { get; set; } - public List titles { get; set; } + public List genres { get; set; } + public Images images { get; set; } public string imdb { get; set; } public string mpaa { get; set; } - public bool via_tmdb { get; set; } - public List actors { get; set; } - public List writers { get; set; } + public string original_title { get; set; } + public string plot { get; set; } + public Rating rating { get; set; } + public Release_Date release_date { get; set; } + public string released { get; set; } public int runtime { get; set; } + public string tagline { get; set; } + public List titles { get; set; } + public int tmdb_id { get; set; } public string type { get; set; } - public string released { get; set; } + public bool via_imdb { get; set; } + public bool via_tmdb { get; set; } + public List writers { get; set; } + public int year { get; set; } } public class Release_Date { + public bool bluray { get; set; } public int dvd { get; set; } public int expires { get; set; } public int theater { get; set; } - public bool bluray { get; set; } } public class Files @@ -80,21 +100,19 @@ public class Identifiers public class Movie { - public string status { get; set; } - public Info info { get; set; } - public string _t { get; set; } - public List releases { get; set; } - public string title { get; set; } - public string _rev { get; set; } - public string profile_id { get; set; } public string _id { get; set; } - public List tags { get; set; } - public int last_edit { get; set; } + public string _rev { get; set; } + public string _t { get; set; } public object category_id { get; set; } - public string type { get; set; } public Files files { get; set; } public Identifiers identifiers { get; set; } + public Info info { get; set; } + public int last_edit { get; set; } + public string profile_id { get; set; } + public List releases { get; set; } + public string status { get; set; } + public List tags { get; set; } + public string title { get; set; } + public string type { get; set; } } - - -} +} \ No newline at end of file diff --git a/PlexRequests.Api.Models/Plex/PlexAccount.cs b/PlexRequests.Api.Models/Plex/PlexAccount.cs index be1fbef24..45204e3c2 100644 --- a/PlexRequests.Api.Models/Plex/PlexAccount.cs +++ b/PlexRequests.Api.Models/Plex/PlexAccount.cs @@ -1,9 +1,4 @@ -using System; -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 { diff --git a/PlexRequests.Api.Models/Plex/PlexEpisodeMetadata.cs b/PlexRequests.Api.Models/Plex/PlexEpisodeMetadata.cs new file mode 100644 index 000000000..41f4d1e0a --- /dev/null +++ b/PlexRequests.Api.Models/Plex/PlexEpisodeMetadata.cs @@ -0,0 +1,81 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: PlexEpisodeMetadata.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 PlexRequests.Api.Models.Plex +{ + using System.Xml.Serialization; + using System.Collections.Generic; + + [XmlRoot(ElementName = "MediaContainer")] + public class PlexEpisodeMetadata + { + [XmlElement(ElementName = "Video")] + public List