From 003dd47e3c8b5397ffcfe197b97176f043e80380 Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Sat, 5 Mar 2016 00:07:37 +0000 Subject: [PATCH] mre work --- PlexRequests.Api/Models/PlexSearch.cs | 258 ++++++++++++++++++ PlexRequests.Api/PlexApi.cs | 28 ++ PlexRequests.Api/PlexRequests.Api.csproj | 1 + PlexRequests.Core/Setup.cs | 11 +- .../PlexRequests.Helpers.Tests.csproj | 25 ++ PlexRequests.Helpers.Tests/app.config | 15 + PlexRequests.Helpers.Tests/packages.config | 6 + PlexRequests.UI/Modules/RequestsModule.cs | 16 +- PlexRequests.UI/PlexRequests.UI.csproj | 30 ++ PlexRequests.UI/Startup.cs | 10 +- PlexRequests.UI/app.config | 28 +- PlexRequests.UI/packages.config | 8 + PlexRequests.UI/web.config | 4 +- 13 files changed, 422 insertions(+), 18 deletions(-) create mode 100644 PlexRequests.Api/Models/PlexSearch.cs create mode 100644 PlexRequests.Helpers.Tests/app.config diff --git a/PlexRequests.Api/Models/PlexSearch.cs b/PlexRequests.Api/Models/PlexSearch.cs new file mode 100644 index 000000000..28a72e6f4 --- /dev/null +++ b/PlexRequests.Api/Models/PlexSearch.cs @@ -0,0 +1,258 @@ +#region Copyright +// /************************************************************************ +// Copyright (c) 2016 Jamie Rees +// File: PlexSearch.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.Xml.Serialization; + +namespace PlexRequests.Api.Models +{ + [XmlRoot(ElementName = "Part")] + public class Part + { + [XmlAttribute(AttributeName = "id")] + public string Id { get; set; } + [XmlAttribute(AttributeName = "key")] + public string Key { get; set; } + [XmlAttribute(AttributeName = "duration")] + public string Duration { get; set; } + [XmlAttribute(AttributeName = "file")] + public string File { get; set; } + [XmlAttribute(AttributeName = "size")] + public string Size { get; set; } + [XmlAttribute(AttributeName = "audioProfile")] + public string AudioProfile { get; set; } + [XmlAttribute(AttributeName = "container")] + public string Container { get; set; } + [XmlAttribute(AttributeName = "videoProfile")] + public string VideoProfile { get; set; } + [XmlAttribute(AttributeName = "has64bitOffsets")] + public string Has64bitOffsets { get; set; } + [XmlAttribute(AttributeName = "hasChapterTextStream")] + public string HasChapterTextStream { get; set; } + [XmlAttribute(AttributeName = "optimizedForStreaming")] + public string OptimizedForStreaming { get; set; } + } + + [XmlRoot(ElementName = "Media")] + public class Media + { + [XmlElement(ElementName = "Part")] + public Part Part { get; set; } + [XmlAttribute(AttributeName = "videoResolution")] + public string VideoResolution { get; set; } + [XmlAttribute(AttributeName = "id")] + public string Id { get; set; } + [XmlAttribute(AttributeName = "duration")] + public string Duration { get; set; } + [XmlAttribute(AttributeName = "bitrate")] + public string Bitrate { get; set; } + [XmlAttribute(AttributeName = "width")] + public string Width { get; set; } + [XmlAttribute(AttributeName = "height")] + public string Height { get; set; } + [XmlAttribute(AttributeName = "aspectRatio")] + public string AspectRatio { get; set; } + [XmlAttribute(AttributeName = "audioChannels")] + public string AudioChannels { get; set; } + [XmlAttribute(AttributeName = "audioCodec")] + public string AudioCodec { get; set; } + [XmlAttribute(AttributeName = "videoCodec")] + public string VideoCodec { get; set; } + [XmlAttribute(AttributeName = "container")] + public string Container { get; set; } + [XmlAttribute(AttributeName = "videoFrameRate")] + public string VideoFrameRate { get; set; } + [XmlAttribute(AttributeName = "audioProfile")] + public string AudioProfile { get; set; } + [XmlAttribute(AttributeName = "videoProfile")] + public string VideoProfile { get; set; } + [XmlAttribute(AttributeName = "optimizedForStreaming")] + public string OptimizedForStreaming { get; set; } + [XmlAttribute(AttributeName = "has64bitOffsets")] + public string Has64bitOffsets { get; set; } + } + + [XmlRoot(ElementName = "Genre")] + public class Genre + { + [XmlAttribute(AttributeName = "tag")] + public string Tag { get; set; } + } + + [XmlRoot(ElementName = "Writer")] + public class Writer + { + [XmlAttribute(AttributeName = "tag")] + public string Tag { get; set; } + } + + [XmlRoot(ElementName = "Director")] + public class Director + { + [XmlAttribute(AttributeName = "tag")] + public string Tag { get; set; } + } + + [XmlRoot(ElementName = "Country")] + public class Country + { + [XmlAttribute(AttributeName = "tag")] + public string Tag { get; set; } + } + + [XmlRoot(ElementName = "Role")] + public class Role + { + [XmlAttribute(AttributeName = "tag")] + public string Tag { get; set; } + } + + [XmlRoot(ElementName = "Video")] + public class Video + { + [XmlElement(ElementName = "Media")] + public List Media { get; set; } + [XmlElement(ElementName = "Genre")] + public List Genre { get; set; } + [XmlElement(ElementName = "Writer")] + public List Writer { get; set; } + [XmlElement(ElementName = "Director")] + public Director Director { get; set; } + [XmlElement(ElementName = "Country")] + public Country Country { get; set; } + [XmlElement(ElementName = "Role")] + public List Role { get; set; } + [XmlAttribute(AttributeName = "allowSync")] + public string AllowSync { get; set; } + [XmlAttribute(AttributeName = "librarySectionID")] + public string LibrarySectionID { get; set; } + [XmlAttribute(AttributeName = "librarySectionTitle")] + public string LibrarySectionTitle { get; set; } + [XmlAttribute(AttributeName = "librarySectionUUID")] + public string LibrarySectionUUID { get; set; } + [XmlAttribute(AttributeName = "personal")] + public string Personal { get; set; } + [XmlAttribute(AttributeName = "sourceTitle")] + public string SourceTitle { get; set; } + [XmlAttribute(AttributeName = "ratingKey")] + public string RatingKey { get; set; } + [XmlAttribute(AttributeName = "key")] + public string Key { get; set; } + [XmlAttribute(AttributeName = "studio")] + public string Studio { get; set; } + [XmlAttribute(AttributeName = "type")] + public string Type { get; set; } + [XmlAttribute(AttributeName = "title")] + public string Title { get; set; } + [XmlAttribute(AttributeName = "contentRating")] + public string ContentRating { get; set; } + [XmlAttribute(AttributeName = "summary")] + public string Summary { get; set; } + [XmlAttribute(AttributeName = "rating")] + public string Rating { get; set; } + [XmlAttribute(AttributeName = "audienceRating")] + public string AudienceRating { get; set; } + [XmlAttribute(AttributeName = "year")] + public string Year { get; set; } + [XmlAttribute(AttributeName = "tagline")] + public string Tagline { get; set; } + [XmlAttribute(AttributeName = "thumb")] + public string Thumb { get; set; } + [XmlAttribute(AttributeName = "art")] + public string Art { get; set; } + [XmlAttribute(AttributeName = "duration")] + public string Duration { get; set; } + [XmlAttribute(AttributeName = "originallyAvailableAt")] + public string OriginallyAvailableAt { get; set; } + [XmlAttribute(AttributeName = "addedAt")] + public string AddedAt { get; set; } + [XmlAttribute(AttributeName = "updatedAt")] + public string UpdatedAt { get; set; } + [XmlAttribute(AttributeName = "audienceRatingImage")] + public string AudienceRatingImage { get; set; } + [XmlAttribute(AttributeName = "chapterSource")] + public string ChapterSource { get; set; } + [XmlAttribute(AttributeName = "ratingImage")] + public string RatingImage { get; set; } + [XmlAttribute(AttributeName = "titleSort")] + public string TitleSort { get; set; } + [XmlAttribute(AttributeName = "parentRatingKey")] + public string ParentRatingKey { get; set; } + [XmlAttribute(AttributeName = "grandparentRatingKey")] + public string GrandparentRatingKey { get; set; } + [XmlAttribute(AttributeName = "grandparentKey")] + public string GrandparentKey { get; set; } + [XmlAttribute(AttributeName = "parentKey")] + public string ParentKey { get; set; } + [XmlAttribute(AttributeName = "grandparentTitle")] + public string GrandparentTitle { get; set; } + [XmlAttribute(AttributeName = "index")] + public string Index { get; set; } + [XmlAttribute(AttributeName = "parentIndex")] + public string ParentIndex { get; set; } + [XmlAttribute(AttributeName = "parentThumb")] + public string ParentThumb { get; set; } + [XmlAttribute(AttributeName = "grandparentThumb")] + public string GrandparentThumb { get; set; } + [XmlAttribute(AttributeName = "grandparentArt")] + public string GrandparentArt { get; set; } + [XmlAttribute(AttributeName = "viewCount")] + public string ViewCount { get; set; } + [XmlAttribute(AttributeName = "lastViewedAt")] + public string LastViewedAt { get; set; } + [XmlAttribute(AttributeName = "grandparentTheme")] + public string GrandparentTheme { get; set; } + } + + [XmlRoot(ElementName = "Provider")] + public class Provider + { + [XmlAttribute(AttributeName = "key")] + public string Key { get; set; } + [XmlAttribute(AttributeName = "title")] + public string Title { get; set; } + [XmlAttribute(AttributeName = "type")] + public string Type { get; set; } + } + + [XmlRoot(ElementName = "MediaContainer")] + public class PlexSearch + { + [XmlElement(ElementName = "Video")] + public List