diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-21 22:08:34 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-21 22:08:34 -0400 |
| commit | c7f559f8cefa4c4b90df3bff72290c8bd5b18e01 (patch) | |
| tree | 4d26b4995e7df5d44c39d76ba58db66f1e48dbc4 /MediaBrowser.Model | |
| parent | f8c603d5ebc28e03140df4f1b155c97b387f09a5 (diff) | |
make model project portable
Diffstat (limited to 'MediaBrowser.Model')
30 files changed, 186 insertions, 142 deletions
diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs index 385e98f61..70345d2bc 100644 --- a/MediaBrowser.Model/Dlna/CodecProfile.cs +++ b/MediaBrowser.Model/Dlna/CodecProfile.cs @@ -6,17 +6,14 @@ namespace MediaBrowser.Model.Dlna { public class CodecProfile { - [XmlAttribute("type")] public CodecType Type { get; set; } public ProfileCondition[] Conditions { get; set; } public ProfileCondition[] ApplyConditions { get; set; } - [XmlAttribute("codec")] public string Codec { get; set; } - [XmlAttribute("container")] public string Container { get; set; } public CodecProfile() diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs index ec13cacfa..6628e290e 100644 --- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs +++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs @@ -1,6 +1,7 @@ using MediaBrowser.Model.Extensions; using MediaBrowser.Model.MediaInfo; using System; +using System.Globalization; namespace MediaBrowser.Model.Dlna { @@ -86,8 +87,8 @@ namespace MediaBrowser.Model.Dlna } } - public bool IsVideoAudioConditionSatisfied(ProfileCondition condition, - int? audioChannels, + public bool IsVideoAudioConditionSatisfied(ProfileCondition condition, + int? audioChannels, int? audioBitrate, string audioProfile, bool? isSecondaryTrack) @@ -116,7 +117,7 @@ namespace MediaBrowser.Model.Dlna } int expected; - if (IntHelper.TryParseCultureInvariant(condition.Value, out expected)) + if (int.TryParse(condition.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out expected)) { switch (condition.Condition) { @@ -149,9 +150,9 @@ namespace MediaBrowser.Model.Dlna switch (condition.Condition) { case ProfileConditionType.EqualsAny: - { - return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue); - } + { + return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue); + } case ProfileConditionType.Equals: return StringHelper.EqualsIgnoreCase(currentValue, expected); case ProfileConditionType.NotEquals: @@ -214,7 +215,7 @@ namespace MediaBrowser.Model.Dlna return false; } - + private bool IsConditionSatisfied(ProfileCondition condition, double? currentValue) { if (!currentValue.HasValue) @@ -243,7 +244,7 @@ namespace MediaBrowser.Model.Dlna return false; } - + private bool IsConditionSatisfied(ProfileCondition condition, TransportStreamTimestamp? timestamp) { if (!timestamp.HasValue) @@ -251,9 +252,9 @@ namespace MediaBrowser.Model.Dlna // If the value is unknown, it satisfies if not marked as required return !condition.IsRequired; } - + TransportStreamTimestamp expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true); - + switch (condition.Condition) { case ProfileConditionType.Equals: diff --git a/MediaBrowser.Model/Dlna/ContainerProfile.cs b/MediaBrowser.Model/Dlna/ContainerProfile.cs index 931194dd3..92f2fc7c0 100644 --- a/MediaBrowser.Model/Dlna/ContainerProfile.cs +++ b/MediaBrowser.Model/Dlna/ContainerProfile.cs @@ -5,11 +5,9 @@ namespace MediaBrowser.Model.Dlna { public class ContainerProfile { - [XmlAttribute("type")] public DlnaProfileType Type { get; set; } public ProfileCondition[] Conditions { get; set; } - [XmlAttribute("container")] public string Container { get; set; } public ContainerProfile() diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs index 884a9f29d..791213441 100644 --- a/MediaBrowser.Model/Dlna/DeviceProfile.cs +++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs @@ -1,11 +1,10 @@ using MediaBrowser.Model.Extensions; using MediaBrowser.Model.MediaInfo; using System.Collections.Generic; -using System.Xml.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Model.Dlna { - [XmlRoot("Profile")] public class DeviceProfile { /// <summary> @@ -14,10 +13,10 @@ namespace MediaBrowser.Model.Dlna /// <value>The name.</value> public string Name { get; set; } - [XmlIgnore] + [IgnoreDataMember] public string Id { get; set; } - [XmlIgnore] + [IgnoreDataMember] public DeviceProfileType ProfileType { get; set; } /// <summary> diff --git a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs index 183299425..3847a3671 100644 --- a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs +++ b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs @@ -1,20 +1,15 @@ using System.Collections.Generic; -using System.Xml.Serialization; namespace MediaBrowser.Model.Dlna { public class DirectPlayProfile { - [XmlAttribute("container")] public string Container { get; set; } - [XmlAttribute("audioCodec")] public string AudioCodec { get; set; } - [XmlAttribute("videoCodec")] public string VideoCodec { get; set; } - [XmlAttribute("type")] public DlnaProfileType Type { get; set; } public List<string> GetContainers() diff --git a/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs b/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs index 926963ef6..517757281 100644 --- a/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs +++ b/MediaBrowser.Model/Dlna/HttpHeaderInfo.cs @@ -4,13 +4,10 @@ namespace MediaBrowser.Model.Dlna { public class HttpHeaderInfo { - [XmlAttribute("name")] public string Name { get; set; } - [XmlAttribute("value")] public string Value { get; set; } - [XmlAttribute("match")] public HeaderMatchType Match { get; set; } } }
\ No newline at end of file diff --git a/MediaBrowser.Model/Dlna/ProfileCondition.cs b/MediaBrowser.Model/Dlna/ProfileCondition.cs index 9234a2713..587c628ff 100644 --- a/MediaBrowser.Model/Dlna/ProfileCondition.cs +++ b/MediaBrowser.Model/Dlna/ProfileCondition.cs @@ -4,16 +4,12 @@ namespace MediaBrowser.Model.Dlna { public class ProfileCondition { - [XmlAttribute("condition")] public ProfileConditionType Condition { get; set; } - [XmlAttribute("property")] public ProfileConditionValue Property { get; set; } - [XmlAttribute("value")] public string Value { get; set; } - [XmlAttribute("isRequired")] public bool IsRequired { get; set; } public ProfileCondition() diff --git a/MediaBrowser.Model/Dlna/ResponseProfile.cs b/MediaBrowser.Model/Dlna/ResponseProfile.cs index c1735f3b7..15d76df82 100644 --- a/MediaBrowser.Model/Dlna/ResponseProfile.cs +++ b/MediaBrowser.Model/Dlna/ResponseProfile.cs @@ -5,22 +5,16 @@ namespace MediaBrowser.Model.Dlna { public class ResponseProfile { - [XmlAttribute("container")] public string Container { get; set; } - [XmlAttribute("audioCodec")] public string AudioCodec { get; set; } - [XmlAttribute("videoCodec")] public string VideoCodec { get; set; } - [XmlAttribute("type")] public DlnaProfileType Type { get; set; } - [XmlAttribute("orgPn")] public string OrgPn { get; set; } - [XmlAttribute("mimeType")] public string MimeType { get; set; } public ProfileCondition[] Conditions { get; set; } diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 18e46b84c..a3e447d04 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -6,6 +6,7 @@ using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.Session; using System; using System.Collections.Generic; +using System.Globalization; namespace MediaBrowser.Model.Dlna { @@ -483,7 +484,7 @@ namespace MediaBrowser.Model.Dlna if (!string.IsNullOrEmpty(transcodingProfile.MaxAudioChannels)) { int transcodingMaxAudioChannels; - if (IntHelper.TryParseCultureInvariant(transcodingProfile.MaxAudioChannels, out transcodingMaxAudioChannels)) + if (int.TryParse(transcodingProfile.MaxAudioChannels, NumberStyles.Any, CultureInfo.InvariantCulture, out transcodingMaxAudioChannels)) { playlistItem.TranscodingMaxAudioChannels = transcodingMaxAudioChannels; } @@ -1039,7 +1040,7 @@ namespace MediaBrowser.Model.Dlna case ProfileConditionValue.AudioBitrate: { int num; - if (IntHelper.TryParseCultureInvariant(value, out num)) + if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num)) { item.AudioBitrate = num; } @@ -1048,7 +1049,7 @@ namespace MediaBrowser.Model.Dlna case ProfileConditionValue.AudioChannels: { int num; - if (IntHelper.TryParseCultureInvariant(value, out num)) + if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num)) { item.MaxAudioChannels = num; } @@ -1069,7 +1070,7 @@ namespace MediaBrowser.Model.Dlna case ProfileConditionValue.RefFrames: { int num; - if (IntHelper.TryParseCultureInvariant(value, out num)) + if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num)) { item.MaxRefFrames = num; } @@ -1078,7 +1079,7 @@ namespace MediaBrowser.Model.Dlna case ProfileConditionValue.VideoBitDepth: { int num; - if (IntHelper.TryParseCultureInvariant(value, out num)) + if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num)) { item.MaxVideoBitDepth = num; } @@ -1092,7 +1093,7 @@ namespace MediaBrowser.Model.Dlna case ProfileConditionValue.Height: { int num; - if (IntHelper.TryParseCultureInvariant(value, out num)) + if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num)) { item.MaxHeight = num; } @@ -1101,7 +1102,7 @@ namespace MediaBrowser.Model.Dlna case ProfileConditionValue.VideoBitrate: { int num; - if (IntHelper.TryParseCultureInvariant(value, out num)) + if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num)) { item.VideoBitrate = num; } @@ -1119,7 +1120,7 @@ namespace MediaBrowser.Model.Dlna case ProfileConditionValue.VideoLevel: { int num; - if (IntHelper.TryParseCultureInvariant(value, out num)) + if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num)) { item.VideoLevel = num; } @@ -1128,7 +1129,7 @@ namespace MediaBrowser.Model.Dlna case ProfileConditionValue.Width: { int num; - if (IntHelper.TryParseCultureInvariant(value, out num)) + if (int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out num)) { item.MaxWidth = num; } diff --git a/MediaBrowser.Model/Dlna/SubtitleProfile.cs b/MediaBrowser.Model/Dlna/SubtitleProfile.cs index 0723de222..ea7e0bda8 100644 --- a/MediaBrowser.Model/Dlna/SubtitleProfile.cs +++ b/MediaBrowser.Model/Dlna/SubtitleProfile.cs @@ -6,16 +6,12 @@ namespace MediaBrowser.Model.Dlna { public class SubtitleProfile { - [XmlAttribute("format")] public string Format { get; set; } - [XmlAttribute("method")] public SubtitleDeliveryMethod Method { get; set; } - [XmlAttribute("didlMode")] public string DidlMode { get; set; } - [XmlAttribute("language")] public string Language { get; set; } public List<string> GetLanguages() diff --git a/MediaBrowser.Model/Dlna/TranscodingProfile.cs b/MediaBrowser.Model/Dlna/TranscodingProfile.cs index eeab99678..15127dcba 100644 --- a/MediaBrowser.Model/Dlna/TranscodingProfile.cs +++ b/MediaBrowser.Model/Dlna/TranscodingProfile.cs @@ -5,43 +5,30 @@ namespace MediaBrowser.Model.Dlna { public class TranscodingProfile { - [XmlAttribute("container")] public string Container { get; set; } - [XmlAttribute("type")] public DlnaProfileType Type { get; set; } - [XmlAttribute("videoCodec")] public string VideoCodec { get; set; } - [XmlAttribute("audioCodec")] public string AudioCodec { get; set; } - [XmlAttribute("protocol")] public string Protocol { get; set; } - [XmlAttribute("estimateContentLength")] public bool EstimateContentLength { get; set; } - [XmlAttribute("enableMpegtsM2TsMode")] public bool EnableMpegtsM2TsMode { get; set; } - [XmlAttribute("transcodeSeekInfo")] public TranscodeSeekInfo TranscodeSeekInfo { get; set; } - [XmlAttribute("copyTimestamps")] public bool CopyTimestamps { get; set; } - [XmlAttribute("context")] public EncodingContext Context { get; set; } - [XmlAttribute("enableSubtitlesInManifest")] public bool EnableSubtitlesInManifest { get; set; } - [XmlAttribute("enableSplittingOnNonKeyFrames")] public bool EnableSplittingOnNonKeyFrames { get; set; } - [XmlAttribute("maxAudioChannels")] public string MaxAudioChannels { get; set; } public List<string> GetAudioCodecs() diff --git a/MediaBrowser.Model/Dlna/XmlAttribute.cs b/MediaBrowser.Model/Dlna/XmlAttribute.cs index e8e13ba0d..661ccf4b6 100644 --- a/MediaBrowser.Model/Dlna/XmlAttribute.cs +++ b/MediaBrowser.Model/Dlna/XmlAttribute.cs @@ -4,10 +4,8 @@ namespace MediaBrowser.Model.Dlna { public class XmlAttribute { - [XmlAttribute("name")] public string Name { get; set; } - [XmlAttribute("value")] public string Value { get; set; } } }
\ No newline at end of file diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 9267222ad..8a3396e27 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -8,7 +8,7 @@ using MediaBrowser.Model.Sync; using System; using System.Collections.Generic; using System.Diagnostics; -using System.Runtime.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Model.Dto { diff --git a/MediaBrowser.Model/Dto/BaseItemPerson.cs b/MediaBrowser.Model/Dto/BaseItemPerson.cs index 7052f1b82..e73872cb7 100644 --- a/MediaBrowser.Model/Dto/BaseItemPerson.cs +++ b/MediaBrowser.Model/Dto/BaseItemPerson.cs @@ -1,5 +1,5 @@ using System.Diagnostics; -using System.Runtime.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Model.Dto { diff --git a/MediaBrowser.Model/Dto/ChapterInfoDto.cs b/MediaBrowser.Model/Dto/ChapterInfoDto.cs index a71d97990..51e0a545a 100644 --- a/MediaBrowser.Model/Dto/ChapterInfoDto.cs +++ b/MediaBrowser.Model/Dto/ChapterInfoDto.cs @@ -1,5 +1,5 @@ using System.Diagnostics; -using System.Runtime.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Model.Dto { diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs index 0b047f9e8..814368d32 100644 --- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs +++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs @@ -3,7 +3,7 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.Extensions; using MediaBrowser.Model.MediaInfo; using System.Collections.Generic; -using System.Runtime.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Model.Dto { diff --git a/MediaBrowser.Model/Dto/StudioDto.cs b/MediaBrowser.Model/Dto/StudioDto.cs index a0027cc4e..13623fb1a 100644 --- a/MediaBrowser.Model/Dto/StudioDto.cs +++ b/MediaBrowser.Model/Dto/StudioDto.cs @@ -1,6 +1,6 @@ using System.ComponentModel; using System.Diagnostics; -using System.Runtime.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Model.Dto { diff --git a/MediaBrowser.Model/Dto/UserDto.cs b/MediaBrowser.Model/Dto/UserDto.cs index 94e4f95a3..f9e3f7718 100644 --- a/MediaBrowser.Model/Dto/UserDto.cs +++ b/MediaBrowser.Model/Dto/UserDto.cs @@ -3,7 +3,7 @@ using MediaBrowser.Model.Connect; using MediaBrowser.Model.Users; using System; using System.Diagnostics; -using System.Runtime.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Model.Dto { diff --git a/MediaBrowser.Model/Entities/BaseItemInfo.cs b/MediaBrowser.Model/Entities/BaseItemInfo.cs index 88af18289..af9091a78 100644 --- a/MediaBrowser.Model/Entities/BaseItemInfo.cs +++ b/MediaBrowser.Model/Entities/BaseItemInfo.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Runtime.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Model.Entities { diff --git a/MediaBrowser.Model/Extensions/IntHelper.cs b/MediaBrowser.Model/Extensions/IntHelper.cs deleted file mode 100644 index 6c5f26080..000000000 --- a/MediaBrowser.Model/Extensions/IntHelper.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Globalization; - -namespace MediaBrowser.Model.Extensions -{ - /// <summary> - /// Isolating these helpers allow this entire project to be easily converted to Java - /// </summary> - public static class IntHelper - { - /// <summary> - /// Tries the parse culture invariant. - /// </summary> - /// <param name="s">The s.</param> - /// <param name="result">The result.</param> - /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> - public static bool TryParseCultureInvariant(string s, out int result) - { - return int.TryParse(s, NumberStyles.Any, CultureInfo.InvariantCulture, out result); - } - } -} diff --git a/MediaBrowser.Model/Extensions/LinqExtensions.cs b/MediaBrowser.Model/Extensions/LinqExtensions.cs new file mode 100644 index 000000000..6b2bdb4c7 --- /dev/null +++ b/MediaBrowser.Model/Extensions/LinqExtensions.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Model.Extensions +{ + // MoreLINQ - Extensions to LINQ to Objects + // Copyright (c) 2008 Jonathan Skeet. All rights reserved. + // + // Licensed under the Apache License, Version 2.0 (the "License"); + // you may not use this file except in compliance with the License. + // You may obtain a copy of the License at + // + // http://www.apache.org/licenses/LICENSE-2.0 + // + // Unless required by applicable law or agreed to in writing, software + // distributed under the License is distributed on an "AS IS" BASIS, + // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + // See the License for the specific language governing permissions and + // limitations under the License. + + public static class LinqExtensions + { + /// <summary> + /// Returns all distinct elements of the given source, where "distinctness" + /// is determined via a projection and the default equality comparer for the projected type. + /// </summary> + /// <remarks> + /// This operator uses deferred execution and streams the results, although + /// a set of already-seen keys is retained. If a key is seen multiple times, + /// only the first element with that key is returned. + /// </remarks> + /// <typeparam name="TSource">Type of the source sequence</typeparam> + /// <typeparam name="TKey">Type of the projected element</typeparam> + /// <param name="source">Source sequence</param> + /// <param name="keySelector">Projection for determining "distinctness"</param> + /// <returns>A sequence consisting of distinct elements from the source sequence, + /// comparing them by the specified key projection.</returns> + + public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, + Func<TSource, TKey> keySelector) + { + return source.DistinctBy(keySelector, null); + } + + /// <summary> + /// Returns all distinct elements of the given source, where "distinctness" + /// is determined via a projection and the specified comparer for the projected type. + /// </summary> + /// <remarks> + /// This operator uses deferred execution and streams the results, although + /// a set of already-seen keys is retained. If a key is seen multiple times, + /// only the first element with that key is returned. + /// </remarks> + /// <typeparam name="TSource">Type of the source sequence</typeparam> + /// <typeparam name="TKey">Type of the projected element</typeparam> + /// <param name="source">Source sequence</param> + /// <param name="keySelector">Projection for determining "distinctness"</param> + /// <param name="comparer">The equality comparer to use to determine whether or not keys are equal. + /// If null, the default equality comparer for <c>TSource</c> is used.</param> + /// <returns>A sequence consisting of distinct elements from the source sequence, + /// comparing them by the specified key projection.</returns> + + public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, + Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer) + { + if (source == null) throw new ArgumentNullException("source"); + if (keySelector == null) throw new ArgumentNullException("keySelector"); + return DistinctByImpl(source, keySelector, comparer); + } + + private static IEnumerable<TSource> DistinctByImpl<TSource, TKey>(IEnumerable<TSource> source, + Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer) + { + var knownKeys = new HashSet<TKey>(comparer); + foreach (var element in source) + { + if (knownKeys.Add(keySelector(element))) + { + yield return element; + } + } + } + } +} diff --git a/MediaBrowser.Model/Health/IHealthMonitor.cs b/MediaBrowser.Model/Health/IHealthMonitor.cs new file mode 100644 index 000000000..a4f95c1bc --- /dev/null +++ b/MediaBrowser.Model/Health/IHealthMonitor.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Model.Notifications; + +namespace MediaBrowser.Model.Health +{ + public interface IHealthMonitor + { + Task<List<Notification>> GetNotifications(CancellationToken cancellationToken); + } +} diff --git a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs index 8991aad86..a8ea86494 100644 --- a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs @@ -3,7 +3,7 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.Library; using System.Collections.Generic; using System.Diagnostics; -using System.Runtime.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Model.LiveTv { diff --git a/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs b/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs index 997b090ff..388001287 100644 --- a/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs +++ b/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Runtime.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Model.LiveTv { diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index d89861821..6c9197c16 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> + <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}</ProjectGuid> @@ -9,12 +10,11 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MediaBrowser.Model</RootNamespace> <AssemblyName>MediaBrowser.Model</AssemblyName> + <DefaultLanguage>en-US</DefaultLanguage> <FileAlignment>512</FileAlignment> - <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> + <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <TargetFrameworkProfile>Profile7</TargetFrameworkProfile> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> - <ReleaseVersion> - </ReleaseVersion> - <NuGetPackageImportStamp>60e95275</NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -24,7 +24,6 @@ <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <PlatformTarget>AnyCPU</PlatformTarget> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> @@ -34,21 +33,10 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Mono|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release Mono\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup> - <RunPostBuildEvent>Always</RunPostBuildEvent> - </PropertyGroup> - <PropertyGroup> - <AssemblyOriginatorKeyFile> - </AssemblyOriginatorKeyFile> - </PropertyGroup> + <ItemGroup> + <None Include="project.json" /> + <!-- A reference to the entire .NET Framework is automatically included --> + </ItemGroup> <ItemGroup> <Compile Include="..\SharedVersion.cs"> <Link>Properties\SharedVersion.cs</Link> @@ -115,8 +103,15 @@ <Compile Include="Devices\LocalFileInfo.cs" /> <Compile Include="Devices\DeviceInfo.cs" /> <Compile Include="Devices\DevicesOptions.cs" /> + <Compile Include="Dlna\CodecProfile.cs" /> + <Compile Include="Dlna\ContainerProfile.cs" /> + <Compile Include="Dlna\DeviceProfile.cs" /> + <Compile Include="Dlna\DirectPlayProfile.cs" /> <Compile Include="Dlna\EncodingContext.cs" /> + <Compile Include="Dlna\HttpHeaderInfo.cs" /> <Compile Include="Dlna\ITranscoderSupport.cs" /> + <Compile Include="Dlna\ProfileCondition.cs" /> + <Compile Include="Dlna\ResponseProfile.cs" /> <Compile Include="Dlna\StreamInfoSorter.cs" /> <Compile Include="Dlna\PlaybackErrorCode.cs" /> <Compile Include="Dlna\PlaybackException.cs" /> @@ -124,7 +119,10 @@ <Compile Include="Dlna\ResolutionNormalizer.cs" /> <Compile Include="Dlna\ResolutionOptions.cs" /> <Compile Include="Dlna\SubtitleDeliveryMethod.cs" /> + <Compile Include="Dlna\SubtitleProfile.cs" /> <Compile Include="Dlna\SubtitleStreamInfo.cs" /> + <Compile Include="Dlna\TranscodingProfile.cs" /> + <Compile Include="Dlna\XmlAttribute.cs" /> <Compile Include="Drawing\ImageOrientation.cs" /> <Compile Include="Dto\IHasServerId.cs" /> <Compile Include="Dto\IHasSyncInfo.cs" /> @@ -132,7 +130,9 @@ <Compile Include="Dto\MetadataEditorInfo.cs" /> <Compile Include="Dto\NameIdPair.cs" /> <Compile Include="Dto\NameValuePair.cs" /> + <Compile Include="Extensions\LinqExtensions.cs" /> <Compile Include="FileOrganization\SmartMatchInfo.cs" /> + <Compile Include="Health\IHealthMonitor.cs" /> <Compile Include="MediaInfo\LiveStreamRequest.cs" /> <Compile Include="MediaInfo\LiveStreamResponse.cs" /> <Compile Include="MediaInfo\PlaybackInfoRequest.cs" /> @@ -154,7 +154,6 @@ <Compile Include="Configuration\MetadataOptions.cs" /> <Compile Include="Configuration\MetadataPluginSummary.cs" /> <Compile Include="Configuration\MetadataPluginType.cs" /> - <Compile Include="Dlna\SubtitleProfile.cs" /> <Compile Include="MediaInfo\MediaProtocol.cs" /> <Compile Include="MediaInfo\SubtitleTrackEvent.cs" /> <Compile Include="MediaInfo\SubtitleTrackInfo.cs" /> @@ -172,36 +171,27 @@ <Compile Include="Providers\SubtitleOptions.cs" /> <Compile Include="Configuration\UnratedItem.cs" /> <Compile Include="Dlna\AudioOptions.cs" /> - <Compile Include="Dlna\CodecProfile.cs" /> <Compile Include="Dlna\CodecType.cs" /> <Compile Include="Dlna\ConditionProcessor.cs" /> - <Compile Include="Dlna\ContainerProfile.cs" /> <Compile Include="Dlna\ContentFeatureBuilder.cs" /> <Compile Include="Dlna\DeviceIdentification.cs" /> - <Compile Include="Dlna\DeviceProfile.cs" /> <Compile Include="Dlna\DeviceProfileInfo.cs" /> <Compile Include="Dlna\DeviceProfileType.cs" /> - <Compile Include="Dlna\DirectPlayProfile.cs" /> <Compile Include="Dlna\DlnaFlags.cs" /> <Compile Include="Dlna\DlnaMaps.cs" /> <Compile Include="Dlna\DlnaProfileType.cs" /> <Compile Include="Dlna\HeaderMatchType.cs" /> - <Compile Include="Dlna\HttpHeaderInfo.cs" /> <Compile Include="Dlna\MediaFormatProfile.cs" /> <Compile Include="Dlna\MediaFormatProfileResolver.cs" /> - <Compile Include="Dlna\ProfileCondition.cs" /> <Compile Include="Dlna\ProfileConditionType.cs" /> <Compile Include="Dlna\ProfileConditionValue.cs" /> - <Compile Include="Dlna\ResponseProfile.cs" /> <Compile Include="Dlna\SearchCriteria.cs" /> <Compile Include="Dlna\SearchType.cs" /> <Compile Include="Dlna\SortCriteria.cs" /> <Compile Include="Dlna\StreamBuilder.cs" /> <Compile Include="Dlna\StreamInfo.cs" /> <Compile Include="Dlna\TranscodeSeekInfo.cs" /> - <Compile Include="Dlna\TranscodingProfile.cs" /> <Compile Include="Dlna\VideoOptions.cs" /> - <Compile Include="Dlna\XmlAttribute.cs" /> <Compile Include="Drawing\ImageFormat.cs" /> <Compile Include="Drawing\ImageSize.cs" /> <Compile Include="Dto\BaseItemPerson.cs" /> @@ -226,7 +216,6 @@ <Compile Include="Entities\SortOrder.cs" /> <Compile Include="Events\GenericEventArgs.cs" /> <Compile Include="Extensions\DoubleHelper.cs" /> - <Compile Include="Extensions\IntHelper.cs" /> <Compile Include="Extensions\ListHelper.cs" /> <Compile Include="Extensions\StringHelper.cs" /> <Compile Include="FileOrganization\EpisodeFileOrganizationRequest.cs" /> @@ -316,6 +305,7 @@ <Compile Include="Querying\UserQuery.cs" /> <Compile Include="Registration\RegistrationInfo.cs" /> <Compile Include="Search\SearchQuery.cs" /> + <Compile Include="Serialization\IgnoreDataMemberAttribute.cs" /> <Compile Include="Session\BrowseRequest.cs" /> <Compile Include="Session\ClientCapabilities.cs" /> <Compile Include="Session\GeneralCommand.cs" /> @@ -434,20 +424,7 @@ <Compile Include="Users\UserActionType.cs" /> <Compile Include="Users\UserPolicy.cs" /> </ItemGroup> - <ItemGroup> - <Reference Include="Microsoft.CSharp" /> - <Reference Include="System" /> - <Reference Include="System.Core" /> - <Reference Include="System.Runtime.Serialization" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <PropertyGroup> - <PostBuildEvent /> - </PropertyGroup> - <PropertyGroup> - <PostBuildEvent /> - </PropertyGroup> + <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> diff --git a/MediaBrowser.Model/MediaBrowser.Model.snk b/MediaBrowser.Model/MediaBrowser.Model.snk Binary files differdeleted file mode 100644 index f8188c78e..000000000 --- a/MediaBrowser.Model/MediaBrowser.Model.snk +++ /dev/null diff --git a/MediaBrowser.Model/Serialization/IgnoreDataMemberAttribute.cs b/MediaBrowser.Model/Serialization/IgnoreDataMemberAttribute.cs new file mode 100644 index 000000000..8e23edc24 --- /dev/null +++ b/MediaBrowser.Model/Serialization/IgnoreDataMemberAttribute.cs @@ -0,0 +1,12 @@ +using System; + +namespace MediaBrowser.Model.Serialization +{ + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = false, AllowMultiple = false)] + public sealed class IgnoreDataMemberAttribute : Attribute + { + public IgnoreDataMemberAttribute() + { + } + } +} diff --git a/MediaBrowser.Model/Updates/PackageVersionInfo.cs b/MediaBrowser.Model/Updates/PackageVersionInfo.cs index 22404b6f6..5e0631b3b 100644 --- a/MediaBrowser.Model/Updates/PackageVersionInfo.cs +++ b/MediaBrowser.Model/Updates/PackageVersionInfo.cs @@ -1,5 +1,5 @@ using System; -using System.Runtime.Serialization; +using MediaBrowser.Model.Serialization; namespace MediaBrowser.Model.Updates { diff --git a/MediaBrowser.Model/project.json b/MediaBrowser.Model/project.json new file mode 100644 index 000000000..61c570126 --- /dev/null +++ b/MediaBrowser.Model/project.json @@ -0,0 +1,7 @@ +{ + "supports": {}, + "dependencies": {}, + "frameworks": { + ".NETPortable,Version=v4.5,Profile=Profile7": {} + } +}
\ No newline at end of file diff --git a/MediaBrowser.Model/project.lock.json b/MediaBrowser.Model/project.lock.json new file mode 100644 index 000000000..a0af19f8f --- /dev/null +++ b/MediaBrowser.Model/project.lock.json @@ -0,0 +1,14 @@ +{ + "locked": false, + "version": 2, + "targets": { + ".NETPortable,Version=v4.5,Profile=Profile7": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "": [], + ".NETPortable,Version=v4.5,Profile=Profile7": [] + }, + "tools": {}, + "projectFileToolGroups": {} +}
\ No newline at end of file |
