aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Activity/IActivityManager.cs3
-rw-r--r--MediaBrowser.Model/Activity/IActivityRepository.cs3
-rw-r--r--MediaBrowser.Model/Channels/AllChannelMediaQuery.cs4
-rw-r--r--MediaBrowser.Model/Channels/ChannelFeatures.cs12
-rw-r--r--MediaBrowser.Model/Configuration/EncodingOptions.cs3
-rw-r--r--MediaBrowser.Model/Configuration/MetadataOptions.cs3
-rw-r--r--MediaBrowser.Model/Configuration/MetadataPluginSummary.cs8
-rw-r--r--MediaBrowser.Model/Configuration/ServerConfiguration.cs1
-rw-r--r--MediaBrowser.Model/Devices/ContentUploadHistory.cs4
-rw-r--r--MediaBrowser.Model/Dlna/AudioOptions.cs2
-rw-r--r--MediaBrowser.Model/Dlna/CodecProfile.cs19
-rw-r--r--MediaBrowser.Model/Dlna/ContainerProfile.cs20
-rw-r--r--MediaBrowser.Model/Dlna/DeviceProfile.cs22
-rw-r--r--MediaBrowser.Model/Dlna/DirectPlayProfile.cs18
-rw-r--r--MediaBrowser.Model/Dlna/ITranscoderSupport.cs5
-rw-r--r--MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs60
-rw-r--r--MediaBrowser.Model/Dlna/ResolutionNormalizer.cs4
-rw-r--r--MediaBrowser.Model/Dlna/ResponseProfile.cs20
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs77
-rw-r--r--MediaBrowser.Model/Dlna/StreamInfo.cs28
-rw-r--r--MediaBrowser.Model/Dlna/StreamInfoSorter.cs4
-rw-r--r--MediaBrowser.Model/Dlna/SubtitleProfile.cs13
-rw-r--r--MediaBrowser.Model/Dlna/TranscodingProfile.cs9
-rw-r--r--MediaBrowser.Model/Dto/BaseItemDto.cs4
-rw-r--r--MediaBrowser.Model/Dto/GameSystemSummary.cs4
-rw-r--r--MediaBrowser.Model/Dto/ItemLayout.cs72
-rw-r--r--MediaBrowser.Model/Dto/MediaSourceInfo.cs22
-rw-r--r--MediaBrowser.Model/Dto/MetadataEditorInfo.cs20
-rw-r--r--MediaBrowser.Model/Entities/LibraryUpdateInfo.cs23
-rw-r--r--MediaBrowser.Model/Entities/VirtualFolderInfo.cs4
-rw-r--r--MediaBrowser.Model/Extensions/ListHelper.cs18
-rw-r--r--MediaBrowser.Model/Globalization/ILocalizationManager.cs8
-rw-r--r--MediaBrowser.Model/Health/IHealthMonitor.cs12
-rw-r--r--MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs2
-rw-r--r--MediaBrowser.Model/LiveTv/ChannelInfoDto.cs4
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvInfo.cs8
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvOptions.cs10
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs4
-rw-r--r--MediaBrowser.Model/LiveTv/LiveTvTunerInfoDto.cs4
-rw-r--r--MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs14
-rw-r--r--MediaBrowser.Model/MediaBrowser.Model.csproj3
-rw-r--r--MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs6
-rw-r--r--MediaBrowser.Model/MediaInfo/MediaInfo.cs20
-rw-r--r--MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs4
-rw-r--r--MediaBrowser.Model/MediaInfo/SubtitleTrackInfo.cs4
-rw-r--r--MediaBrowser.Model/Net/MimeTypes.cs2
-rw-r--r--MediaBrowser.Model/Notifications/NotificationTypeInfo.cs4
-rw-r--r--MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs4
-rw-r--r--MediaBrowser.Model/Providers/ImageProviderInfo.cs4
-rw-r--r--MediaBrowser.Model/Providers/RemoteImageResult.cs4
-rw-r--r--MediaBrowser.Model/Querying/ItemsResult.cs11
-rw-r--r--MediaBrowser.Model/Querying/QueryResult.cs3
-rw-r--r--MediaBrowser.Model/Querying/ThemeMediaResult.cs5
-rw-r--r--MediaBrowser.Model/Services/QueryParamCollection.cs67
-rw-r--r--MediaBrowser.Model/Session/ClientCapabilities.cs12
-rw-r--r--MediaBrowser.Model/Session/SessionInfoDto.cs12
-rw-r--r--MediaBrowser.Model/Session/TranscodingInfo.cs4
-rw-r--r--MediaBrowser.Model/Session/UserDataChangeInfo.cs2
-rw-r--r--MediaBrowser.Model/Social/ISharingManager.cs2
-rw-r--r--MediaBrowser.Model/Social/ISharingRepository.cs7
-rw-r--r--MediaBrowser.Model/Sync/CompleteSyncJobInfo.cs4
-rw-r--r--MediaBrowser.Model/Sync/LocalItem.cs8
-rw-r--r--MediaBrowser.Model/Sync/SyncDataRequest.cs11
-rw-r--r--MediaBrowser.Model/Sync/SyncDataResponse.cs9
-rw-r--r--MediaBrowser.Model/Sync/SyncDialogOptions.cs16
-rw-r--r--MediaBrowser.Model/Sync/SyncJob.cs4
-rw-r--r--MediaBrowser.Model/Sync/SyncJobCreationResult.cs4
-rw-r--r--MediaBrowser.Model/Sync/SyncJobItem.cs4
-rw-r--r--MediaBrowser.Model/Sync/SyncJobRequest.cs4
-rw-r--r--MediaBrowser.Model/Sync/SyncedItem.cs4
-rw-r--r--MediaBrowser.Model/System/SystemInfo.cs12
-rw-r--r--MediaBrowser.Model/Updates/PackageInfo.cs4
-rw-r--r--MediaBrowser.Model/Updates/PackageVersionInfo.cs2
73 files changed, 359 insertions, 482 deletions
diff --git a/MediaBrowser.Model/Activity/IActivityManager.cs b/MediaBrowser.Model/Activity/IActivityManager.cs
index 7032dff14..396be9573 100644
--- a/MediaBrowser.Model/Activity/IActivityManager.cs
+++ b/MediaBrowser.Model/Activity/IActivityManager.cs
@@ -1,5 +1,4 @@
using System;
-using System.Threading.Tasks;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Querying;
@@ -9,7 +8,7 @@ namespace MediaBrowser.Model.Activity
{
event EventHandler<GenericEventArgs<ActivityLogEntry>> EntryCreated;
- Task Create(ActivityLogEntry entry);
+ void Create(ActivityLogEntry entry);
QueryResult<ActivityLogEntry> GetActivityLogEntries(DateTime? minDate, int? startIndex, int? limit);
}
diff --git a/MediaBrowser.Model/Activity/IActivityRepository.cs b/MediaBrowser.Model/Activity/IActivityRepository.cs
index c1952d436..8ee87ee2e 100644
--- a/MediaBrowser.Model/Activity/IActivityRepository.cs
+++ b/MediaBrowser.Model/Activity/IActivityRepository.cs
@@ -1,12 +1,11 @@
using System;
-using System.Threading.Tasks;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Model.Activity
{
public interface IActivityRepository
{
- Task Create(ActivityLogEntry entry);
+ void Create(ActivityLogEntry entry);
QueryResult<ActivityLogEntry> GetActivityLogEntries(DateTime? minDate, int? startIndex, int? limit);
}
diff --git a/MediaBrowser.Model/Channels/AllChannelMediaQuery.cs b/MediaBrowser.Model/Channels/AllChannelMediaQuery.cs
index c5631899e..920f3e4b2 100644
--- a/MediaBrowser.Model/Channels/AllChannelMediaQuery.cs
+++ b/MediaBrowser.Model/Channels/AllChannelMediaQuery.cs
@@ -52,10 +52,10 @@ namespace MediaBrowser.Model.Channels
TrailerTypes = new TrailerType[] { };
Filters = new ItemFilter[] { };
- Fields = new List<ItemFields>();
+ Fields = new ItemFields[]{};
}
public ItemFilter[] Filters { get; set; }
- public List<ItemFields> Fields { get; set; }
+ public ItemFields[] Fields { get; set; }
}
} \ No newline at end of file
diff --git a/MediaBrowser.Model/Channels/ChannelFeatures.cs b/MediaBrowser.Model/Channels/ChannelFeatures.cs
index 8dfdbcd7a..39b40cabc 100644
--- a/MediaBrowser.Model/Channels/ChannelFeatures.cs
+++ b/MediaBrowser.Model/Channels/ChannelFeatures.cs
@@ -26,13 +26,13 @@ namespace MediaBrowser.Model.Channels
/// Gets or sets the media types.
/// </summary>
/// <value>The media types.</value>
- public List<ChannelMediaType> MediaTypes { get; set; }
+ public ChannelMediaType[] MediaTypes { get; set; }
/// <summary>
/// Gets or sets the content types.
/// </summary>
/// <value>The content types.</value>
- public List<ChannelMediaContentType> ContentTypes { get; set; }
+ public ChannelMediaContentType[] ContentTypes { get; set; }
/// <summary>
/// Represents the maximum number of records the channel allows retrieving at a time
@@ -49,7 +49,7 @@ namespace MediaBrowser.Model.Channels
/// Gets or sets the default sort orders.
/// </summary>
/// <value>The default sort orders.</value>
- public List<ChannelItemSortField> DefaultSortFields { get; set; }
+ public ChannelItemSortField[] DefaultSortFields { get; set; }
/// <summary>
/// Indicates if a sort ascending/descending toggle is supported or not.
@@ -76,10 +76,10 @@ namespace MediaBrowser.Model.Channels
public ChannelFeatures()
{
- MediaTypes = new List<ChannelMediaType>();
- ContentTypes = new List<ChannelMediaContentType>();
+ MediaTypes = new ChannelMediaType[] { };
+ ContentTypes = new ChannelMediaContentType[] { };
- DefaultSortFields = new List<ChannelItemSortField>();
+ DefaultSortFields = new ChannelItemSortField[] { };
}
}
}
diff --git a/MediaBrowser.Model/Configuration/EncodingOptions.cs b/MediaBrowser.Model/Configuration/EncodingOptions.cs
index d619e3140..b093d82e3 100644
--- a/MediaBrowser.Model/Configuration/EncodingOptions.cs
+++ b/MediaBrowser.Model/Configuration/EncodingOptions.cs
@@ -14,6 +14,7 @@ namespace MediaBrowser.Model.Configuration
public int H264Crf { get; set; }
public string H264Preset { get; set; }
public bool EnableHardwareEncoding { get; set; }
+ public bool EnableSubtitleExtraction { get; set; }
public string[] HardwareDecodingCodecs { get; set; }
@@ -26,7 +27,7 @@ namespace MediaBrowser.Model.Configuration
VaapiDevice = "/dev/dri/card0";
H264Crf = 23;
EnableHardwareEncoding = true;
-
+ EnableSubtitleExtraction = true;
HardwareDecodingCodecs = new string[] { "h264", "vc1" };
}
}
diff --git a/MediaBrowser.Model/Configuration/MetadataOptions.cs b/MediaBrowser.Model/Configuration/MetadataOptions.cs
index ddde688b2..8a41decbf 100644
--- a/MediaBrowser.Model/Configuration/MetadataOptions.cs
+++ b/MediaBrowser.Model/Configuration/MetadataOptions.cs
@@ -29,7 +29,7 @@ namespace MediaBrowser.Model.Configuration
public MetadataOptions(int backdropLimit, int minBackdropWidth)
{
- List<ImageOption> imageOptions = new List<ImageOption>
+ ImageOptions = new[]
{
new ImageOption
{
@@ -39,7 +39,6 @@ namespace MediaBrowser.Model.Configuration
}
};
- ImageOptions = imageOptions.ToArray();
DisabledMetadataSavers = new string[] { };
LocalMetadataReaderOrder = new string[] { };
diff --git a/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs b/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs
index 90b3933eb..80142cf43 100644
--- a/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs
+++ b/MediaBrowser.Model/Configuration/MetadataPluginSummary.cs
@@ -15,18 +15,18 @@ namespace MediaBrowser.Model.Configuration
/// Gets or sets the plugins.
/// </summary>
/// <value>The plugins.</value>
- public List<MetadataPlugin> Plugins { get; set; }
+ public MetadataPlugin[] Plugins { get; set; }
/// <summary>
/// Gets or sets the supported image types.
/// </summary>
/// <value>The supported image types.</value>
- public List<ImageType> SupportedImageTypes { get; set; }
+ public ImageType[] SupportedImageTypes { get; set; }
public MetadataPluginSummary()
{
- SupportedImageTypes = new List<ImageType>();
- Plugins = new List<MetadataPlugin>();
+ SupportedImageTypes = new ImageType[] { };
+ Plugins = new MetadataPlugin[] { };
}
}
} \ No newline at end of file
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
index db66837e4..5177a757a 100644
--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs
+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs
@@ -217,6 +217,7 @@ namespace MediaBrowser.Model.Configuration
EnableHttps = false;
EnableDashboardResponseCaching = true;
EnableAnonymousUsageReporting = true;
+ EnableCaseSensitiveItemIds = true;
EnableAutomaticRestart = true;
diff --git a/MediaBrowser.Model/Devices/ContentUploadHistory.cs b/MediaBrowser.Model/Devices/ContentUploadHistory.cs
index cd4858d90..2b344df24 100644
--- a/MediaBrowser.Model/Devices/ContentUploadHistory.cs
+++ b/MediaBrowser.Model/Devices/ContentUploadHistory.cs
@@ -5,11 +5,11 @@ namespace MediaBrowser.Model.Devices
public class ContentUploadHistory
{
public string DeviceId { get; set; }
- public List<LocalFileInfo> FilesUploaded { get; set; }
+ public LocalFileInfo[] FilesUploaded { get; set; }
public ContentUploadHistory()
{
- FilesUploaded = new List<LocalFileInfo>();
+ FilesUploaded = new LocalFileInfo[] { };
}
}
}
diff --git a/MediaBrowser.Model/Dlna/AudioOptions.cs b/MediaBrowser.Model/Dlna/AudioOptions.cs
index 24c7aef98..6584bb3cc 100644
--- a/MediaBrowser.Model/Dlna/AudioOptions.cs
+++ b/MediaBrowser.Model/Dlna/AudioOptions.cs
@@ -22,7 +22,7 @@ namespace MediaBrowser.Model.Dlna
public bool ForceDirectStream { get; set; }
public string ItemId { get; set; }
- public List<MediaSourceInfo> MediaSources { get; set; }
+ public MediaSourceInfo[] MediaSources { get; set; }
public DeviceProfile Profile { get; set; }
/// <summary>
diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs
index 14b1875c1..d75547adb 100644
--- a/MediaBrowser.Model/Dlna/CodecProfile.cs
+++ b/MediaBrowser.Model/Dlna/CodecProfile.cs
@@ -26,19 +26,9 @@ namespace MediaBrowser.Model.Dlna
ApplyConditions = new ProfileCondition[] { };
}
- private static List<string> SplitValue(string value)
+ public string[] GetCodecs()
{
- List<string> list = new List<string>();
- foreach (string i in (value ?? string.Empty).Split(','))
- {
- if (!string.IsNullOrEmpty(i)) list.Add(i);
- }
- return list;
- }
-
- public List<string> GetCodecs()
- {
- return SplitValue(Codec);
+ return ContainerProfile.SplitValue(Codec);
}
private bool ContainsContainer(string container)
@@ -53,10 +43,9 @@ namespace MediaBrowser.Model.Dlna
return false;
}
- List<string> codecs = GetCodecs();
+ var codecs = GetCodecs();
- return codecs.Count == 0 || ListHelper.ContainsIgnoreCase(codecs, SplitValue(codec)[0]);
- //return codecs.Count == 0 || SplitValue(codec).Any(i => ListHelper.ContainsIgnoreCase(codecs, i));
+ return codecs.Length == 0 || ListHelper.ContainsIgnoreCase(codecs, ContainerProfile.SplitValue(codec)[0]);
}
}
}
diff --git a/MediaBrowser.Model/Dlna/ContainerProfile.cs b/MediaBrowser.Model/Dlna/ContainerProfile.cs
index 2004cfc1f..23bbf0193 100644
--- a/MediaBrowser.Model/Dlna/ContainerProfile.cs
+++ b/MediaBrowser.Model/Dlna/ContainerProfile.cs
@@ -20,24 +20,26 @@ namespace MediaBrowser.Model.Dlna
Conditions = new ProfileCondition[] { };
}
- public List<string> GetContainers()
+ public string[] GetContainers()
{
return SplitValue(Container);
}
- public static List<string> SplitValue(string value)
+ private static readonly string[] EmptyStringArray = new string[] { };
+
+ public static string[] SplitValue(string value)
{
- List<string> list = new List<string>();
- foreach (string i in (value ?? string.Empty).Split(','))
+ if (string.IsNullOrWhiteSpace(value))
{
- if (!string.IsNullOrWhiteSpace(i)) list.Add(i);
+ return EmptyStringArray;
}
- return list;
+
+ return value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
}
public bool ContainsContainer(string container)
{
- List<string> containers = GetContainers();
+ var containers = GetContainers();
return ContainsContainer(containers, container);
}
@@ -47,9 +49,9 @@ namespace MediaBrowser.Model.Dlna
return ContainsContainer(SplitValue(profileContainers), inputContainer);
}
- public static bool ContainsContainer(List<string> profileContainers, string inputContainer)
+ public static bool ContainsContainer(string[] profileContainers, string inputContainer)
{
- if (profileContainers.Count == 0)
+ if (profileContainers.Length == 0)
{
return true;
}
diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs
index 5f9bd772c..d6f0eafc7 100644
--- a/MediaBrowser.Model/Dlna/DeviceProfile.cs
+++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs
@@ -117,15 +117,9 @@ namespace MediaBrowser.Model.Dlna
MusicStreamingTranscodingBitrate = 128000;
}
- public List<string> GetSupportedMediaTypes()
+ public string[] GetSupportedMediaTypes()
{
- List<string> list = new List<string>();
- foreach (string i in (SupportedMediaTypes ?? string.Empty).Split(','))
- {
- if (!string.IsNullOrEmpty(i))
- list.Add(i);
- }
- return list;
+ return ContainerProfile.SplitValue(SupportedMediaTypes);
}
public TranscodingProfile GetAudioTranscodingProfile(string container, string audioCodec)
@@ -199,8 +193,8 @@ namespace MediaBrowser.Model.Dlna
continue;
}
- List<string> audioCodecs = i.GetAudioCodecs();
- if (audioCodecs.Count > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
+ var audioCodecs = i.GetAudioCodecs();
+ if (audioCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
{
continue;
}
@@ -306,14 +300,14 @@ namespace MediaBrowser.Model.Dlna
continue;
}
- List<string> audioCodecs = i.GetAudioCodecs();
- if (audioCodecs.Count > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
+ var audioCodecs = i.GetAudioCodecs();
+ if (audioCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
{
continue;
}
- List<string> videoCodecs = i.GetVideoCodecs();
- if (videoCodecs.Count > 0 && !ListHelper.ContainsIgnoreCase(videoCodecs, videoCodec ?? string.Empty))
+ var videoCodecs = i.GetVideoCodecs();
+ if (videoCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(videoCodecs, videoCodec ?? string.Empty))
{
continue;
}
diff --git a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs
index e80f59be4..7430c449f 100644
--- a/MediaBrowser.Model/Dlna/DirectPlayProfile.cs
+++ b/MediaBrowser.Model/Dlna/DirectPlayProfile.cs
@@ -23,24 +23,14 @@ namespace MediaBrowser.Model.Dlna
return ContainerProfile.ContainsContainer(Container, container);
}
- public List<string> GetAudioCodecs()
+ public string[] GetAudioCodecs()
{
- List<string> list = new List<string>();
- foreach (string i in (AudioCodec ?? string.Empty).Split(','))
- {
- if (!string.IsNullOrEmpty(i)) list.Add(i);
- }
- return list;
+ return ContainerProfile.SplitValue(AudioCodec);
}
- public List<string> GetVideoCodecs()
+ public string[] GetVideoCodecs()
{
- List<string> list = new List<string>();
- foreach (string i in (VideoCodec ?? string.Empty).Split(','))
- {
- if (!string.IsNullOrEmpty(i)) list.Add(i);
- }
- return list;
+ return ContainerProfile.SplitValue(VideoCodec);
}
}
}
diff --git a/MediaBrowser.Model/Dlna/ITranscoderSupport.cs b/MediaBrowser.Model/Dlna/ITranscoderSupport.cs
index fd615733d..14723bd27 100644
--- a/MediaBrowser.Model/Dlna/ITranscoderSupport.cs
+++ b/MediaBrowser.Model/Dlna/ITranscoderSupport.cs
@@ -4,6 +4,7 @@
{
bool CanEncodeToAudioCodec(string codec);
bool CanEncodeToSubtitleCodec(string codec);
+ bool CanExtractSubtitles(string codec);
}
public class FullTranscoderSupport : ITranscoderSupport
@@ -16,5 +17,9 @@
{
return true;
}
+ public bool CanExtractSubtitles(string codec)
+ {
+ return true;
+ }
}
}
diff --git a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs
index a464b045b..034e0fe6a 100644
--- a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs
+++ b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs
@@ -7,33 +7,33 @@ namespace MediaBrowser.Model.Dlna
{
public class MediaFormatProfileResolver
{
- public List<MediaFormatProfile> ResolveVideoFormat(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
+ public MediaFormatProfile[] ResolveVideoFormat(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
{
if (StringHelper.EqualsIgnoreCase(container, "asf"))
{
MediaFormatProfile? val = ResolveVideoASFFormat(videoCodec, audioCodec, width, height);
- return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>();
+ return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[]{};
}
if (StringHelper.EqualsIgnoreCase(container, "mp4"))
{
MediaFormatProfile? val = ResolveVideoMP4Format(videoCodec, audioCodec, width, height);
- return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>();
+ return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
}
if (StringHelper.EqualsIgnoreCase(container, "avi"))
- return new List<MediaFormatProfile> { MediaFormatProfile.AVI };
+ return new MediaFormatProfile[] { MediaFormatProfile.AVI };
if (StringHelper.EqualsIgnoreCase(container, "mkv"))
- return new List<MediaFormatProfile> { MediaFormatProfile.MATROSKA };
+ return new MediaFormatProfile[] { MediaFormatProfile.MATROSKA };
if (StringHelper.EqualsIgnoreCase(container, "mpeg2ps") ||
StringHelper.EqualsIgnoreCase(container, "ts"))
- return new List<MediaFormatProfile> { MediaFormatProfile.MPEG_PS_NTSC, MediaFormatProfile.MPEG_PS_PAL };
+ return new MediaFormatProfile[] { MediaFormatProfile.MPEG_PS_NTSC, MediaFormatProfile.MPEG_PS_PAL };
if (StringHelper.EqualsIgnoreCase(container, "mpeg1video"))
- return new List<MediaFormatProfile> { MediaFormatProfile.MPEG1 };
+ return new MediaFormatProfile[] { MediaFormatProfile.MPEG1 };
if (StringHelper.EqualsIgnoreCase(container, "mpeg2ts") ||
StringHelper.EqualsIgnoreCase(container, "mpegts") ||
@@ -44,24 +44,24 @@ namespace MediaBrowser.Model.Dlna
}
if (StringHelper.EqualsIgnoreCase(container, "flv"))
- return new List<MediaFormatProfile> { MediaFormatProfile.FLV };
+ return new MediaFormatProfile[] { MediaFormatProfile.FLV };
if (StringHelper.EqualsIgnoreCase(container, "wtv"))
- return new List<MediaFormatProfile> { MediaFormatProfile.WTV };
+ return new MediaFormatProfile[] { MediaFormatProfile.WTV };
if (StringHelper.EqualsIgnoreCase(container, "3gp"))
{
MediaFormatProfile? val = ResolveVideo3GPFormat(videoCodec, audioCodec);
- return val.HasValue ? new List<MediaFormatProfile> { val.Value } : new List<MediaFormatProfile>();
+ return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
}
if (StringHelper.EqualsIgnoreCase(container, "ogv") || StringHelper.EqualsIgnoreCase(container, "ogg"))
- return new List<MediaFormatProfile> { MediaFormatProfile.OGV };
+ return new MediaFormatProfile[] { MediaFormatProfile.OGV };
- return new List<MediaFormatProfile>();
+ return new MediaFormatProfile[] { };
}
- private List<MediaFormatProfile> ResolveVideoMPEG2TSFormat(string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
+ private MediaFormatProfile[] ResolveVideoMPEG2TSFormat(string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
{
string suffix = "";
@@ -93,41 +93,41 @@ namespace MediaBrowser.Model.Dlna
{
list.Add(MediaFormatProfile.MPEG_TS_JP_T);
}
- return list;
+ return list.ToArray(list.Count);
}
if (StringHelper.EqualsIgnoreCase(videoCodec, "h264"))
{
if (StringHelper.EqualsIgnoreCase(audioCodec, "lpcm"))
- return new List<MediaFormatProfile> { MediaFormatProfile.AVC_TS_HD_50_LPCM_T };
+ return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_50_LPCM_T };
if (StringHelper.EqualsIgnoreCase(audioCodec, "dts"))
{
if (timestampType == TransportStreamTimestamp.None)
{
- return new List<MediaFormatProfile> { MediaFormatProfile.AVC_TS_HD_DTS_ISO };
+ return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_DTS_ISO };
}
- return new List<MediaFormatProfile> { MediaFormatProfile.AVC_TS_HD_DTS_T };
+ return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_DTS_T };
}
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp2"))
{
if (timestampType == TransportStreamTimestamp.None)
{
- return new List<MediaFormatProfile> { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_ISO", resolution)) };
+ return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_ISO", resolution)) };
}
- return new List<MediaFormatProfile> { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_T", resolution)) };
+ return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_T", resolution)) };
}
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
- return new List<MediaFormatProfile> { ValueOf(string.Format("AVC_TS_MP_{0}D_AAC_MULT5{1}", resolution, suffix)) };
+ return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AAC_MULT5{1}", resolution, suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
- return new List<MediaFormatProfile> { ValueOf(string.Format("AVC_TS_MP_{0}D_MPEG1_L3{1}", resolution, suffix)) };
+ return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_MPEG1_L3{1}", resolution, suffix)) };
if (string.IsNullOrEmpty(audioCodec) ||
StringHelper.EqualsIgnoreCase(audioCodec, "ac3"))
- return new List<MediaFormatProfile> { ValueOf(string.Format("AVC_TS_MP_{0}D_AC3{1}", resolution, suffix)) };
+ return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AC3{1}", resolution, suffix)) };
}
else if (StringHelper.EqualsIgnoreCase(videoCodec, "vc1"))
{
@@ -135,31 +135,31 @@ namespace MediaBrowser.Model.Dlna
{
if ((width.HasValue && width.Value > 720) || (height.HasValue && height.Value > 576))
{
- return new List<MediaFormatProfile> { MediaFormatProfile.VC1_TS_AP_L2_AC3_ISO };
+ return new MediaFormatProfile[] { MediaFormatProfile.VC1_TS_AP_L2_AC3_ISO };
}
- return new List<MediaFormatProfile> { MediaFormatProfile.VC1_TS_AP_L1_AC3_ISO };
+ return new MediaFormatProfile[] { MediaFormatProfile.VC1_TS_AP_L1_AC3_ISO };
}
if (StringHelper.EqualsIgnoreCase(audioCodec, "dts"))
{
suffix = StringHelper.EqualsIgnoreCase(suffix, "_ISO") ? suffix : "_T";
- return new List<MediaFormatProfile> { ValueOf(string.Format("VC1_TS_HD_DTS{0}", suffix)) };
+ return new MediaFormatProfile[] { ValueOf(string.Format("VC1_TS_HD_DTS{0}", suffix)) };
}
}
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg4") || StringHelper.EqualsIgnoreCase(videoCodec, "msmpeg4"))
{
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
- return new List<MediaFormatProfile> { ValueOf(string.Format("MPEG4_P2_TS_ASP_AAC{0}", suffix)) };
+ return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AAC{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
- return new List<MediaFormatProfile> { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG1_L3{0}", suffix)) };
+ return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG1_L3{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp2"))
- return new List<MediaFormatProfile> { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG2_L2{0}", suffix)) };
+ return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG2_L2{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "ac3"))
- return new List<MediaFormatProfile> { ValueOf(string.Format("MPEG4_P2_TS_ASP_AC3{0}", suffix)) };
+ return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AC3{0}", suffix)) };
}
- return new List<MediaFormatProfile>();
+ return new MediaFormatProfile[]{};
}
private MediaFormatProfile ValueOf(string value)
diff --git a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
index 950d3680d..ae74e255b 100644
--- a/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
+++ b/MediaBrowser.Model/Dlna/ResolutionNormalizer.cs
@@ -6,8 +6,8 @@ namespace MediaBrowser.Model.Dlna
{
public class ResolutionNormalizer
{
- private static readonly List<ResolutionConfiguration> Configurations =
- new List<ResolutionConfiguration>
+ private static readonly ResolutionConfiguration[] Configurations =
+ new []
{
new ResolutionConfiguration(426, 320000),
new ResolutionConfiguration(640, 400000),
diff --git a/MediaBrowser.Model/Dlna/ResponseProfile.cs b/MediaBrowser.Model/Dlna/ResponseProfile.cs
index f1a001bba..742253fa3 100644
--- a/MediaBrowser.Model/Dlna/ResponseProfile.cs
+++ b/MediaBrowser.Model/Dlna/ResponseProfile.cs
@@ -31,29 +31,19 @@ namespace MediaBrowser.Model.Dlna
Conditions = new ProfileCondition[] {};
}
- public List<string> GetContainers()
+ public string[] GetContainers()
{
return ContainerProfile.SplitValue(Container);
}
- public List<string> GetAudioCodecs()
+ public string[] GetAudioCodecs()
{
- List<string> list = new List<string>();
- foreach (string i in (AudioCodec ?? string.Empty).Split(','))
- {
- if (!string.IsNullOrEmpty(i)) list.Add(i);
- }
- return list;
+ return ContainerProfile.SplitValue(AudioCodec);
}
- public List<string> GetVideoCodecs()
+ public string[] GetVideoCodecs()
{
- List<string> list = new List<string>();
- foreach (string i in (VideoCodec ?? string.Empty).Split(','))
- {
- if (!string.IsNullOrEmpty(i)) list.Add(i);
- }
- return list;
+ return ContainerProfile.SplitValue(VideoCodec);
}
}
}
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index 189ed27e4..10c6a05c0 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -31,7 +31,7 @@ namespace MediaBrowser.Model.Dlna
{
ValidateAudioInput(options);
- List<MediaSourceInfo> mediaSources = new List<MediaSourceInfo>();
+ var mediaSources = new List<MediaSourceInfo>();
foreach (MediaSourceInfo i in options.MediaSources)
{
if (string.IsNullOrEmpty(options.MediaSourceId) ||
@@ -41,7 +41,7 @@ namespace MediaBrowser.Model.Dlna
}
}
- List<StreamInfo> streams = new List<StreamInfo>();
+ var streams = new List<StreamInfo>();
foreach (MediaSourceInfo i in mediaSources)
{
StreamInfo streamInfo = BuildAudioItem(i, options);
@@ -64,7 +64,7 @@ namespace MediaBrowser.Model.Dlna
{
ValidateInput(options);
- List<MediaSourceInfo> mediaSources = new List<MediaSourceInfo>();
+ var mediaSources = new List<MediaSourceInfo>();
foreach (MediaSourceInfo i in options.MediaSources)
{
if (string.IsNullOrEmpty(options.MediaSourceId) ||
@@ -74,7 +74,7 @@ namespace MediaBrowser.Model.Dlna
}
}
- List<StreamInfo> streams = new List<StreamInfo>();
+ var streams = new List<StreamInfo>();
foreach (MediaSourceInfo i in mediaSources)
{
StreamInfo streamInfo = BuildVideoItem(i, options);
@@ -95,9 +95,9 @@ namespace MediaBrowser.Model.Dlna
private StreamInfo GetOptimalStream(List<StreamInfo> streams, long? maxBitrate)
{
- streams = StreamInfoSorter.SortMediaSources(streams, maxBitrate);
+ var sorted = StreamInfoSorter.SortMediaSources(streams, maxBitrate);
- foreach (StreamInfo stream in streams)
+ foreach (StreamInfo stream in sorted)
{
return stream;
}
@@ -206,7 +206,7 @@ namespace MediaBrowser.Model.Dlna
var formats = ContainerProfile.SplitValue(inputContainer);
- if (formats.Count == 1)
+ if (formats.Length == 1)
{
return formats[0];
}
@@ -233,7 +233,7 @@ namespace MediaBrowser.Model.Dlna
private StreamInfo BuildAudioItem(MediaSourceInfo item, AudioOptions options)
{
- List<TranscodeReason> transcodeReasons = new List<TranscodeReason>();
+ var transcodeReasons = new List<TranscodeReason>();
StreamInfo playlistItem = new StreamInfo
{
@@ -263,7 +263,7 @@ namespace MediaBrowser.Model.Dlna
var directPlayInfo = GetAudioDirectPlayMethods(item, audioStream, options);
- List<PlayMethod> directPlayMethods = directPlayInfo.Item1;
+ var directPlayMethods = directPlayInfo.Item1;
transcodeReasons.AddRange(directPlayInfo.Item2);
ConditionProcessor conditionProcessor = new ConditionProcessor();
@@ -280,7 +280,7 @@ namespace MediaBrowser.Model.Dlna
// Make sure audio codec profiles are satisfied
if (!string.IsNullOrEmpty(audioCodec))
{
- List<ProfileCondition> conditions = new List<ProfileCondition>();
+ var conditions = new List<ProfileCondition>();
foreach (CodecProfile i in options.Profile.CodecProfiles)
{
if (i.Type == CodecType.Audio && i.ContainsCodec(audioCodec, item.Container))
@@ -372,7 +372,7 @@ namespace MediaBrowser.Model.Dlna
playlistItem.SubProtocol = transcodingProfile.Protocol;
- List<CodecProfile> audioCodecProfiles = new List<CodecProfile>();
+ var audioCodecProfiles = new List<CodecProfile>();
foreach (CodecProfile i in options.Profile.CodecProfiles)
{
if (i.Type == CodecType.Audio && i.ContainsCodec(transcodingProfile.AudioCodec, transcodingProfile.Container))
@@ -383,7 +383,7 @@ namespace MediaBrowser.Model.Dlna
if (audioCodecProfiles.Count >= 1) break;
}
- List<ProfileCondition> audioTranscodingConditions = new List<ProfileCondition>();
+ var audioTranscodingConditions = new List<ProfileCondition>();
foreach (CodecProfile i in audioCodecProfiles)
{
bool applyConditions = true;
@@ -447,7 +447,7 @@ namespace MediaBrowser.Model.Dlna
private Tuple<List<PlayMethod>, List<TranscodeReason>> GetAudioDirectPlayMethods(MediaSourceInfo item, MediaStream audioStream, AudioOptions options)
{
- List<TranscodeReason> transcodeReasons = new List<TranscodeReason>();
+ var transcodeReasons = new List<TranscodeReason>();
DirectPlayProfile directPlayProfile = null;
foreach (DirectPlayProfile i in options.Profile.DirectPlayProfiles)
@@ -459,7 +459,7 @@ namespace MediaBrowser.Model.Dlna
}
}
- List<PlayMethod> playMethods = new List<PlayMethod>();
+ var playMethods = new List<PlayMethod>();
if (directPlayProfile != null)
{
@@ -534,8 +534,8 @@ namespace MediaBrowser.Model.Dlna
if (videoStream != null)
{
// Check video codec
- List<string> videoCodecs = profile.GetVideoCodecs();
- if (videoCodecs.Count > 0)
+ var videoCodecs = profile.GetVideoCodecs();
+ if (videoCodecs.Length > 0)
{
string videoCodec = videoStream.Codec;
if (!string.IsNullOrEmpty(videoCodec) && ListHelper.ContainsIgnoreCase(videoCodecs, videoCodec))
@@ -552,8 +552,8 @@ namespace MediaBrowser.Model.Dlna
if (audioStream != null)
{
// Check audio codec
- List<string> audioCodecs = profile.GetAudioCodecs();
- if (audioCodecs.Count > 0)
+ var audioCodecs = profile.GetAudioCodecs();
+ if (audioCodecs.Length > 0)
{
string audioCodec = audioStream.Codec;
if (!string.IsNullOrEmpty(audioCodec) && ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec))
@@ -602,7 +602,7 @@ namespace MediaBrowser.Model.Dlna
}
}
- List<MediaStream> topStreams = new List<MediaStream>();
+ var topStreams = new List<MediaStream>();
foreach (MediaStream stream in item.MediaStreams)
{
if (stream.Type == MediaStreamType.Subtitle && stream.Score.HasValue && stream.Score.Value == highestScore)
@@ -637,7 +637,7 @@ namespace MediaBrowser.Model.Dlna
throw new ArgumentNullException("item");
}
- List<TranscodeReason> transcodeReasons = new List<TranscodeReason>();
+ var transcodeReasons = new List<TranscodeReason>();
StreamInfo playlistItem = new StreamInfo
{
@@ -686,7 +686,7 @@ namespace MediaBrowser.Model.Dlna
if (subtitleStream != null)
{
- SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, directPlay.Value, null, null);
+ SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, directPlay.Value, _transcoderSupport, null, null);
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
playlistItem.SubtitleFormat = subtitleProfile.Format;
@@ -728,7 +728,7 @@ namespace MediaBrowser.Model.Dlna
if (subtitleStream != null)
{
- SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, PlayMethod.Transcode, transcodingProfile.Protocol, transcodingProfile.Container);
+ SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, PlayMethod.Transcode, _transcoderSupport, transcodingProfile.Protocol, transcodingProfile.Container);
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
playlistItem.SubtitleFormat = subtitleProfile.Format;
@@ -769,7 +769,7 @@ namespace MediaBrowser.Model.Dlna
playlistItem.AudioStreamIndex = audioStreamIndex;
ConditionProcessor conditionProcessor = new ConditionProcessor();
- List<ProfileCondition> videoTranscodingConditions = new List<ProfileCondition>();
+ var videoTranscodingConditions = new List<ProfileCondition>();
foreach (CodecProfile i in options.Profile.CodecProfiles)
{
if (i.Type == CodecType.Video && i.ContainsCodec(transcodingProfile.VideoCodec, transcodingProfile.Container))
@@ -804,7 +804,7 @@ namespace MediaBrowser.Model.Dlna
}
ApplyTranscodingConditions(playlistItem, videoTranscodingConditions);
- List<ProfileCondition> audioTranscodingConditions = new List<ProfileCondition>();
+ var audioTranscodingConditions = new List<ProfileCondition>();
foreach (CodecProfile i in options.Profile.CodecProfiles)
{
if (i.Type == CodecType.VideoAudio && i.ContainsCodec(playlistItem.TargetAudioCodec, transcodingProfile.Container))
@@ -990,7 +990,7 @@ namespace MediaBrowser.Model.Dlna
string container = mediaSource.Container;
- List<ProfileCondition> conditions = new List<ProfileCondition>();
+ var conditions = new List<ProfileCondition>();
foreach (ContainerProfile i in profile.ContainerProfiles)
{
if (i.Type == DlnaProfileType.Video &&
@@ -1183,7 +1183,7 @@ namespace MediaBrowser.Model.Dlna
{
if (subtitleStream != null)
{
- SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, playMethod, null, null);
+ SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, playMethod, _transcoderSupport, null, null);
if (subtitleProfile.Method != SubtitleDeliveryMethod.External && subtitleProfile.Method != SubtitleDeliveryMethod.Embed)
{
@@ -1202,7 +1202,7 @@ namespace MediaBrowser.Model.Dlna
return new Tuple<bool, TranscodeReason?>(result, TranscodeReason.ContainerBitrateExceedsLimit);
}
- public static SubtitleProfile GetSubtitleProfile(MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, PlayMethod playMethod, string transcodingSubProtocol, string transcodingContainer)
+ public static SubtitleProfile GetSubtitleProfile(MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, PlayMethod playMethod, ITranscoderSupport transcoderSupport, string transcodingSubProtocol, string transcodingContainer)
{
if (!subtitleStream.IsExternal && (playMethod != PlayMethod.Transcode || !string.Equals(transcodingSubProtocol, "hls", StringComparison.OrdinalIgnoreCase)))
{
@@ -1256,7 +1256,9 @@ namespace MediaBrowser.Model.Dlna
}
// Look for an external or hls profile that matches the stream type (text/graphical) and doesn't require conversion
- return GetExternalSubtitleProfile(subtitleStream, subtitleProfiles, playMethod, false) ?? GetExternalSubtitleProfile(subtitleStream, subtitleProfiles, playMethod, true) ?? new SubtitleProfile
+ return GetExternalSubtitleProfile(subtitleStream, subtitleProfiles, playMethod, transcoderSupport, false) ??
+ GetExternalSubtitleProfile(subtitleStream, subtitleProfiles, playMethod, transcoderSupport, true) ??
+ new SubtitleProfile
{
Method = SubtitleDeliveryMethod.Encode,
Format = subtitleStream.Codec
@@ -1291,7 +1293,7 @@ namespace MediaBrowser.Model.Dlna
return false;
}
- private static SubtitleProfile GetExternalSubtitleProfile(MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, PlayMethod playMethod, bool allowConversion)
+ private static SubtitleProfile GetExternalSubtitleProfile(MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, PlayMethod playMethod, ITranscoderSupport transcoderSupport, bool allowConversion)
{
foreach (SubtitleProfile profile in subtitleProfiles)
{
@@ -1310,6 +1312,11 @@ namespace MediaBrowser.Model.Dlna
continue;
}
+ if (!subtitleStream.IsExternal && !transcoderSupport.CanExtractSubtitles(subtitleStream.Codec))
+ {
+ continue;
+ }
+
if ((profile.Method == SubtitleDeliveryMethod.External && subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format)) ||
(profile.Method == SubtitleDeliveryMethod.Hls && subtitleStream.IsTextSubtitleStream))
{
@@ -1578,8 +1585,8 @@ namespace MediaBrowser.Model.Dlna
}
// Check audio codec
- List<string> audioCodecs = profile.GetAudioCodecs();
- if (audioCodecs.Count > 0)
+ var audioCodecs = profile.GetAudioCodecs();
+ if (audioCodecs.Length > 0)
{
// Check audio codecs
string audioCodec = audioStream == null ? null : audioStream.Codec;
@@ -1601,8 +1608,8 @@ namespace MediaBrowser.Model.Dlna
}
// Check video codec
- List<string> videoCodecs = profile.GetVideoCodecs();
- if (videoCodecs.Count > 0)
+ var videoCodecs = profile.GetVideoCodecs();
+ if (videoCodecs.Length > 0)
{
string videoCodec = videoStream == null ? null : videoStream.Codec;
if (string.IsNullOrEmpty(videoCodec) || !ListHelper.ContainsIgnoreCase(videoCodecs, videoCodec))
@@ -1614,8 +1621,8 @@ namespace MediaBrowser.Model.Dlna
// Check audio codec
if (audioStream != null)
{
- List<string> audioCodecs = profile.GetAudioCodecs();
- if (audioCodecs.Count > 0)
+ var audioCodecs = profile.GetAudioCodecs();
+ if (audioCodecs.Length > 0)
{
// Check audio codecs
string audioCodec = audioStream == null ? null : audioStream.Codec;
diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs
index f863d8c95..c63e74eaf 100644
--- a/MediaBrowser.Model/Dlna/StreamInfo.cs
+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs
@@ -309,14 +309,14 @@ namespace MediaBrowser.Model.Dlna
return list;
}
- public List<SubtitleStreamInfo> GetExternalSubtitles(bool includeSelectedTrackOnly, string baseUrl, string accessToken)
+ public List<SubtitleStreamInfo> GetExternalSubtitles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, string baseUrl, string accessToken)
{
- return GetExternalSubtitles(includeSelectedTrackOnly, false, baseUrl, accessToken);
+ return GetExternalSubtitles(transcoderSupport, includeSelectedTrackOnly, false, baseUrl, accessToken);
}
- public List<SubtitleStreamInfo> GetExternalSubtitles(bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken)
+ public List<SubtitleStreamInfo> GetExternalSubtitles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken)
{
- List<SubtitleStreamInfo> list = GetSubtitleProfiles(includeSelectedTrackOnly, enableAllProfiles, baseUrl, accessToken);
+ List<SubtitleStreamInfo> list = GetSubtitleProfiles(transcoderSupport, includeSelectedTrackOnly, enableAllProfiles, baseUrl, accessToken);
List<SubtitleStreamInfo> newList = new List<SubtitleStreamInfo>();
// First add the selected track
@@ -331,12 +331,12 @@ namespace MediaBrowser.Model.Dlna
return newList;
}
- public List<SubtitleStreamInfo> GetSubtitleProfiles(bool includeSelectedTrackOnly, string baseUrl, string accessToken)
+ public List<SubtitleStreamInfo> GetSubtitleProfiles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, string baseUrl, string accessToken)
{
- return GetSubtitleProfiles(includeSelectedTrackOnly, false, baseUrl, accessToken);
+ return GetSubtitleProfiles(transcoderSupport, includeSelectedTrackOnly, false, baseUrl, accessToken);
}
- public List<SubtitleStreamInfo> GetSubtitleProfiles(bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken)
+ public List<SubtitleStreamInfo> GetSubtitleProfiles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken)
{
List<SubtitleStreamInfo> list = new List<SubtitleStreamInfo>();
@@ -352,7 +352,7 @@ namespace MediaBrowser.Model.Dlna
{
if (stream.Type == MediaStreamType.Subtitle && stream.Index == SubtitleStreamIndex.Value)
{
- AddSubtitleProfiles(list, stream, enableAllProfiles, baseUrl, accessToken, startPositionTicks);
+ AddSubtitleProfiles(list, stream, transcoderSupport, enableAllProfiles, baseUrl, accessToken, startPositionTicks);
}
}
}
@@ -363,7 +363,7 @@ namespace MediaBrowser.Model.Dlna
{
if (stream.Type == MediaStreamType.Subtitle && (!SubtitleStreamIndex.HasValue || stream.Index != SubtitleStreamIndex.Value))
{
- AddSubtitleProfiles(list, stream, enableAllProfiles, baseUrl, accessToken, startPositionTicks);
+ AddSubtitleProfiles(list, stream, transcoderSupport, enableAllProfiles, baseUrl, accessToken, startPositionTicks);
}
}
}
@@ -371,28 +371,28 @@ namespace MediaBrowser.Model.Dlna
return list;
}
- private void AddSubtitleProfiles(List<SubtitleStreamInfo> list, MediaStream stream, bool enableAllProfiles, string baseUrl, string accessToken, long startPositionTicks)
+ private void AddSubtitleProfiles(List<SubtitleStreamInfo> list, MediaStream stream, ITranscoderSupport transcoderSupport, bool enableAllProfiles, string baseUrl, string accessToken, long startPositionTicks)
{
if (enableAllProfiles)
{
foreach (SubtitleProfile profile in DeviceProfile.SubtitleProfiles)
{
- SubtitleStreamInfo info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, new[] { profile });
+ SubtitleStreamInfo info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, new[] { profile }, transcoderSupport);
list.Add(info);
}
}
else
{
- SubtitleStreamInfo info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, DeviceProfile.SubtitleProfiles);
+ SubtitleStreamInfo info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, DeviceProfile.SubtitleProfiles, transcoderSupport);
list.Add(info);
}
}
- private SubtitleStreamInfo GetSubtitleStreamInfo(MediaStream stream, string baseUrl, string accessToken, long startPositionTicks, SubtitleProfile[] subtitleProfiles)
+ private SubtitleStreamInfo GetSubtitleStreamInfo(MediaStream stream, string baseUrl, string accessToken, long startPositionTicks, SubtitleProfile[] subtitleProfiles, ITranscoderSupport transcoderSupport)
{
- SubtitleProfile subtitleProfile = StreamBuilder.GetSubtitleProfile(stream, subtitleProfiles, PlayMethod, SubProtocol, Container);
+ SubtitleProfile subtitleProfile = StreamBuilder.GetSubtitleProfile(stream, subtitleProfiles, PlayMethod, transcoderSupport, SubProtocol, Container);
SubtitleStreamInfo info = new SubtitleStreamInfo
{
IsForced = stream.IsForced,
diff --git a/MediaBrowser.Model/Dlna/StreamInfoSorter.cs b/MediaBrowser.Model/Dlna/StreamInfoSorter.cs
index badd3c5b1..e13b32767 100644
--- a/MediaBrowser.Model/Dlna/StreamInfoSorter.cs
+++ b/MediaBrowser.Model/Dlna/StreamInfoSorter.cs
@@ -8,7 +8,7 @@ namespace MediaBrowser.Model.Dlna
{
public class StreamInfoSorter
{
- public static List<StreamInfo> SortMediaSources(List<StreamInfo> streams, long? maxBitrate)
+ public static StreamInfo[] SortMediaSources(List<StreamInfo> streams, long? maxBitrate)
{
return streams.OrderBy(i =>
{
@@ -54,7 +54,7 @@ namespace MediaBrowser.Model.Dlna
return 0;
- }).ToList();
+ }).ToArray();
}
}
}
diff --git a/MediaBrowser.Model/Dlna/SubtitleProfile.cs b/MediaBrowser.Model/Dlna/SubtitleProfile.cs
index f182541d8..3f639a520 100644
--- a/MediaBrowser.Model/Dlna/SubtitleProfile.cs
+++ b/MediaBrowser.Model/Dlna/SubtitleProfile.cs
@@ -19,14 +19,9 @@ namespace MediaBrowser.Model.Dlna
[XmlAttribute("language")]
public string Language { get; set; }
- public List<string> GetLanguages()
+ public string[] GetLanguages()
{
- List<string> list = new List<string>();
- foreach (string i in (Language ?? string.Empty).Split(','))
- {
- if (!string.IsNullOrEmpty(i)) list.Add(i);
- }
- return list;
+ return ContainerProfile.SplitValue(Language);
}
public bool SupportsLanguage(string subLanguage)
@@ -41,8 +36,8 @@ namespace MediaBrowser.Model.Dlna
subLanguage = "und";
}
- List<string> languages = GetLanguages();
- return languages.Count == 0 || ListHelper.ContainsIgnoreCase(languages, subLanguage);
+ var languages = GetLanguages();
+ return languages.Length == 0 || ListHelper.ContainsIgnoreCase(languages, subLanguage);
}
}
} \ No newline at end of file
diff --git a/MediaBrowser.Model/Dlna/TranscodingProfile.cs b/MediaBrowser.Model/Dlna/TranscodingProfile.cs
index 9623a68b0..8453fdf6d 100644
--- a/MediaBrowser.Model/Dlna/TranscodingProfile.cs
+++ b/MediaBrowser.Model/Dlna/TranscodingProfile.cs
@@ -51,14 +51,9 @@ namespace MediaBrowser.Model.Dlna
[XmlAttribute("breakOnNonKeyFrames")]
public bool BreakOnNonKeyFrames { get; set; }
- public List<string> GetAudioCodecs()
+ public string[] GetAudioCodecs()
{
- List<string> list = new List<string>();
- foreach (string i in (AudioCodec ?? string.Empty).Split(','))
- {
- if (!string.IsNullOrEmpty(i)) list.Add(i);
- }
- return list;
+ return ContainerProfile.SplitValue(AudioCodec);
}
}
}
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index e0e7e55aa..8bad650b5 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -432,7 +432,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the artists.
/// </summary>
/// <value>The artists.</value>
- public List<string> Artists { get; set; }
+ public string[] Artists { get; set; }
/// <summary>
/// Gets or sets the artist items.
@@ -497,7 +497,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the media streams.
/// </summary>
/// <value>The media streams.</value>
- public List<MediaStream> MediaStreams { get; set; }
+ public MediaStream[] MediaStreams { get; set; }
/// <summary>
/// Gets or sets the type of the video.
diff --git a/MediaBrowser.Model/Dto/GameSystemSummary.cs b/MediaBrowser.Model/Dto/GameSystemSummary.cs
index 1da3bb0ac..2cd9d408d 100644
--- a/MediaBrowser.Model/Dto/GameSystemSummary.cs
+++ b/MediaBrowser.Model/Dto/GameSystemSummary.cs
@@ -29,7 +29,7 @@ namespace MediaBrowser.Model.Dto
/// Gets or sets the game extensions.
/// </summary>
/// <value>The game extensions.</value>
- public List<string> GameFileExtensions { get; set; }
+ public string[] GameFileExtensions { get; set; }
/// <summary>
/// Gets or sets the client installed game count.
@@ -42,7 +42,7 @@ namespace MediaBrowser.Model.Dto
/// </summary>
public GameSystemSummary()
{
- GameFileExtensions = new List<string>();
+ GameFileExtensions = new string[] { };
}
}
}
diff --git a/MediaBrowser.Model/Dto/ItemLayout.cs b/MediaBrowser.Model/Dto/ItemLayout.cs
deleted file mode 100644
index c85818390..000000000
--- a/MediaBrowser.Model/Dto/ItemLayout.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace MediaBrowser.Model.Dto
-{
- public static class ItemLayout
- {
- public static double? GetDisplayAspectRatio(BaseItemDto item)
- {
- List<BaseItemDto> items = new List<BaseItemDto>();
- items.Add(item);
- return GetDisplayAspectRatio(items);
- }
-
- public static double? GetDisplayAspectRatio(List<BaseItemDto> items)
- {
- List<double> values = new List<double>();
-
- foreach (BaseItemDto item in items)
- {
- if (item.PrimaryImageAspectRatio.HasValue)
- {
- values.Add(item.PrimaryImageAspectRatio.Value);
- }
- }
-
- if (values.Count == 0)
- {
- return null;
- }
-
- values.Sort();
-
- double halfDouble = values.Count;
- halfDouble /= 2;
- int half = Convert.ToInt32(Math.Floor(halfDouble));
-
- double result;
-
- if (values.Count % 2 > 0)
- result = values[half];
- else
- result = (values[half - 1] + values[half]) / 2.0;
-
- // If really close to 2:3 (poster image), just return 2:3
- if (Math.Abs(0.66666666667 - result) <= .15)
- {
- return 0.66666666667;
- }
-
- // If really close to 16:9 (episode image), just return 16:9
- if (Math.Abs(1.777777778 - result) <= .2)
- {
- return 1.777777778;
- }
-
- // If really close to 1 (square image), just return 1
- if (Math.Abs(1 - result) <= .15)
- {
- return 1.0;
- }
-
- // If really close to 4:3 (poster image), just return 2:3
- if (Math.Abs(1.33333333333 - result) <= .15)
- {
- return 1.33333333333;
- }
-
- return result;
- }
- }
-}
diff --git a/MediaBrowser.Model/Dto/MediaSourceInfo.cs b/MediaBrowser.Model/Dto/MediaSourceInfo.cs
index 1bf67f66c..27920bdf3 100644
--- a/MediaBrowser.Model/Dto/MediaSourceInfo.cs
+++ b/MediaBrowser.Model/Dto/MediaSourceInfo.cs
@@ -2,7 +2,6 @@
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
using System.Collections.Generic;
-using System.Linq;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Session;
@@ -41,6 +40,7 @@ namespace MediaBrowser.Model.Dto
public string OpenToken { get; set; }
public bool RequiresClosing { get; set; }
public bool SupportsProbing { get; set; }
+ public bool EnableMpDecimate { get; set; }
public string LiveStreamId { get; set; }
public int? BufferMs { get; set; }
@@ -54,7 +54,7 @@ namespace MediaBrowser.Model.Dto
public List<MediaStream> MediaStreams { get; set; }
- public List<string> Formats { get; set; }
+ public string[] Formats { get; set; }
public int? Bitrate { get; set; }
@@ -69,7 +69,7 @@ namespace MediaBrowser.Model.Dto
public MediaSourceInfo()
{
- Formats = new List<string>();
+ Formats = new string[] { };
MediaStreams = new List<MediaStream>();
RequiredHttpHeaders = new Dictionary<string, string>();
SupportsTranscoding = true;
@@ -90,19 +90,15 @@ namespace MediaBrowser.Model.Dto
return;
}
- var internalStreams = MediaStreams
- .Where(i => !i.IsExternal)
- .ToList();
-
- if (internalStreams.Count == 0)
+ var bitrate = 0;
+ foreach (var stream in MediaStreams)
{
- return;
+ if (!stream.IsExternal)
+ {
+ bitrate += stream.BitRate ?? 0;
+ }
}
- var bitrate = internalStreams
- .Select(m => m.BitRate ?? 0)
- .Sum();
-
if (bitrate > 0)
{
Bitrate = bitrate;
diff --git a/MediaBrowser.Model/Dto/MetadataEditorInfo.cs b/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
index 9bd15fc8f..aa8b33c81 100644
--- a/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
+++ b/MediaBrowser.Model/Dto/MetadataEditorInfo.cs
@@ -7,21 +7,21 @@ namespace MediaBrowser.Model.Dto
{
public class MetadataEditorInfo
{
- public List<ParentalRating> ParentalRatingOptions { get; set; }
- public List<CountryInfo> Countries { get; set; }
- public List<CultureDto> Cultures { get; set; }
- public List<ExternalIdInfo> ExternalIdInfos { get; set; }
+ public ParentalRating[] ParentalRatingOptions { get; set; }
+ public CountryInfo[] Countries { get; set; }
+ public CultureDto[] Cultures { get; set; }
+ public ExternalIdInfo[] ExternalIdInfos { get; set; }
public string ContentType { get; set; }
- public List<NameValuePair> ContentTypeOptions { get; set; }
+ public NameValuePair[] ContentTypeOptions { get; set; }
public MetadataEditorInfo()
{
- ParentalRatingOptions = new List<ParentalRating>();
- Countries = new List<CountryInfo>();
- Cultures = new List<CultureDto>();
- ExternalIdInfos = new List<ExternalIdInfo>();
- ContentTypeOptions = new List<NameValuePair>();
+ ParentalRatingOptions = new ParentalRating[] { };
+ Countries = new CountryInfo[] { };
+ Cultures = new CultureDto[] { };
+ ExternalIdInfos = new ExternalIdInfo[] { };
+ ContentTypeOptions = new NameValuePair[] { };
}
}
}
diff --git a/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs
index 07a4b5f60..b3d3be70e 100644
--- a/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs
+++ b/MediaBrowser.Model/Entities/LibraryUpdateInfo.cs
@@ -1,5 +1,4 @@
-using System.Collections.Generic;
-
+
namespace MediaBrowser.Model.Entities
{
/// <summary>
@@ -11,41 +10,41 @@ namespace MediaBrowser.Model.Entities
/// Gets or sets the folders added to.
/// </summary>
/// <value>The folders added to.</value>
- public List<string> FoldersAddedTo { get; set; }
+ public string[] FoldersAddedTo { get; set; }
/// <summary>
/// Gets or sets the folders removed from.
/// </summary>
/// <value>The folders removed from.</value>
- public List<string> FoldersRemovedFrom { get; set; }
+ public string[] FoldersRemovedFrom { get; set; }
/// <summary>
/// Gets or sets the items added.
/// </summary>
/// <value>The items added.</value>
- public List<string> ItemsAdded { get; set; }
+ public string[] ItemsAdded { get; set; }
/// <summary>
/// Gets or sets the items removed.
/// </summary>
/// <value>The items removed.</value>
- public List<string> ItemsRemoved { get; set; }
+ public string[] ItemsRemoved { get; set; }
/// <summary>
/// Gets or sets the items updated.
/// </summary>
/// <value>The items updated.</value>
- public List<string> ItemsUpdated { get; set; }
+ public string[] ItemsUpdated { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="LibraryUpdateInfo"/> class.
/// </summary>
public LibraryUpdateInfo()
{
- FoldersAddedTo = new List<string>();
- FoldersRemovedFrom = new List<string>();
- ItemsAdded = new List<string>();
- ItemsRemoved = new List<string>();
- ItemsUpdated = new List<string>();
+ FoldersAddedTo = new string[] { };
+ FoldersRemovedFrom = new string[] { };
+ ItemsAdded = new string[] { };
+ ItemsRemoved = new string[] { };
+ ItemsUpdated = new string[] { };
}
}
}
diff --git a/MediaBrowser.Model/Entities/VirtualFolderInfo.cs b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs
index 374d8d028..901090717 100644
--- a/MediaBrowser.Model/Entities/VirtualFolderInfo.cs
+++ b/MediaBrowser.Model/Entities/VirtualFolderInfo.cs
@@ -18,7 +18,7 @@ namespace MediaBrowser.Model.Entities
/// Gets or sets the locations.
/// </summary>
/// <value>The locations.</value>
- public List<string> Locations { get; set; }
+ public string[] Locations { get; set; }
/// <summary>
/// Gets or sets the type of the collection.
@@ -33,7 +33,7 @@ namespace MediaBrowser.Model.Entities
/// </summary>
public VirtualFolderInfo()
{
- Locations = new List<string>();
+ Locations = new string[] { };
}
/// <summary>
diff --git a/MediaBrowser.Model/Extensions/ListHelper.cs b/MediaBrowser.Model/Extensions/ListHelper.cs
index 741f07469..6fe1793db 100644
--- a/MediaBrowser.Model/Extensions/ListHelper.cs
+++ b/MediaBrowser.Model/Extensions/ListHelper.cs
@@ -1,28 +1,24 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
namespace MediaBrowser.Model.Extensions
{
public static class ListHelper
{
- public static bool ContainsIgnoreCase(List<string> list, string value)
+ public static bool ContainsIgnoreCase(string[] list, string value)
{
if (value == null)
{
throw new ArgumentNullException("value");
}
- return list.Contains(value, StringComparer.OrdinalIgnoreCase);
- }
- public static bool ContainsIgnoreCase(string[] list, string value)
- {
- if (value == null)
+ foreach (var item in list)
{
- throw new ArgumentNullException("value");
+ if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
}
-
- return list.Contains(value, StringComparer.OrdinalIgnoreCase);
+ return false;
}
public static bool ContainsAnyIgnoreCase(string[] list, string[] values)
diff --git a/MediaBrowser.Model/Globalization/ILocalizationManager.cs b/MediaBrowser.Model/Globalization/ILocalizationManager.cs
index 47cec1459..2356a2fa1 100644
--- a/MediaBrowser.Model/Globalization/ILocalizationManager.cs
+++ b/MediaBrowser.Model/Globalization/ILocalizationManager.cs
@@ -12,17 +12,17 @@ namespace MediaBrowser.Model.Globalization
/// Gets the cultures.
/// </summary>
/// <returns>IEnumerable{CultureDto}.</returns>
- List<CultureDto> GetCultures();
+ CultureDto[] GetCultures();
/// <summary>
/// Gets the countries.
/// </summary>
/// <returns>IEnumerable{CountryInfo}.</returns>
- List<CountryInfo> GetCountries();
+ CountryInfo[] GetCountries();
/// <summary>
/// Gets the parental ratings.
/// </summary>
/// <returns>IEnumerable{ParentalRating}.</returns>
- IEnumerable<ParentalRating> GetParentalRatings();
+ ParentalRating[] GetParentalRatings();
/// <summary>
/// Gets the rating level.
/// </summary>
@@ -49,7 +49,7 @@ namespace MediaBrowser.Model.Globalization
/// Gets the localization options.
/// </summary>
/// <returns>IEnumerable{LocalizatonOption}.</returns>
- IEnumerable<LocalizatonOption> GetLocalizationOptions();
+ LocalizatonOption[] GetLocalizationOptions();
string RemoveDiacritics(string text);
diff --git a/MediaBrowser.Model/Health/IHealthMonitor.cs b/MediaBrowser.Model/Health/IHealthMonitor.cs
deleted file mode 100644
index a4f95c1bc..000000000
--- a/MediaBrowser.Model/Health/IHealthMonitor.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-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/BaseTimerInfoDto.cs b/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs
index 9d7fdd129..7c9fe0790 100644
--- a/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/BaseTimerInfoDto.cs
@@ -113,7 +113,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the parent backdrop image tags.
/// </summary>
/// <value>The parent backdrop image tags.</value>
- public List<string> ParentBackdropImageTags { get; set; }
+ public string[] ParentBackdropImageTags { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is post padding required.
diff --git a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
index a8ea86494..67e3d44da 100644
--- a/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
@@ -41,7 +41,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the media sources.
/// </summary>
/// <value>The media sources.</value>
- public List<MediaSourceInfo> MediaSources { get; set; }
+ public MediaSourceInfo[] MediaSources { get; set; }
/// <summary>
/// Gets or sets the image tags.
@@ -116,7 +116,7 @@ namespace MediaBrowser.Model.LiveTv
public ChannelInfoDto()
{
ImageTags = new Dictionary<ImageType, string>();
- MediaSources = new List<MediaSourceInfo>();
+ MediaSources = new MediaSourceInfo[] { };
}
}
}
diff --git a/MediaBrowser.Model/LiveTv/LiveTvInfo.cs b/MediaBrowser.Model/LiveTv/LiveTvInfo.cs
index f4d3e21d9..4620fbf0c 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvInfo.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvInfo.cs
@@ -8,7 +8,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the services.
/// </summary>
/// <value>The services.</value>
- public List<LiveTvServiceInfo> Services { get; set; }
+ public LiveTvServiceInfo[] Services { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is enabled.
@@ -20,12 +20,12 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the enabled users.
/// </summary>
/// <value>The enabled users.</value>
- public List<string> EnabledUsers { get; set; }
+ public string[] EnabledUsers { get; set; }
public LiveTvInfo()
{
- Services = new List<LiveTvServiceInfo>();
- EnabledUsers = new List<string>();
+ Services = new LiveTvServiceInfo[] { };
+ EnabledUsers = new string[] { };
}
}
} \ No newline at end of file
diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
index a1df35b12..2c2f22e86 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs
@@ -15,8 +15,8 @@ namespace MediaBrowser.Model.LiveTv
public bool EnableOriginalAudioWithEncodedRecordings { get; set; }
public string RecordedVideoCodec { get; set; }
- public List<TunerHostInfo> TunerHosts { get; set; }
- public List<ListingsProviderInfo> ListingProviders { get; set; }
+ public TunerHostInfo[] TunerHosts { get; set; }
+ public ListingsProviderInfo[] ListingProviders { get; set; }
public int PrePaddingSeconds { get; set; }
public int PostPaddingSeconds { get; set; }
@@ -28,8 +28,8 @@ namespace MediaBrowser.Model.LiveTv
public LiveTvOptions()
{
- TunerHosts = new List<TunerHostInfo>();
- ListingProviders = new List<ListingsProviderInfo>();
+ TunerHosts = new TunerHostInfo[] { };
+ ListingProviders = new ListingsProviderInfo[] { };
MediaLocationsCreated = new string[] { };
RecordingEncodingFormat = "mkv";
RecordingPostProcessorArguments = "\"{path}\"";
@@ -47,7 +47,9 @@ namespace MediaBrowser.Model.LiveTv
public bool ImportFavoritesOnly { get; set; }
public bool AllowHWTranscoding { get; set; }
public bool EnableStreamLooping { get; set; }
+ public bool EnableMpDecimate { get; set; }
public bool EnableNewHdhrChannelIds { get; set; }
+ public string Source { get; set; }
public TunerHostInfo()
{
diff --git a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs
index 25d3b289f..09ec4b931 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvServiceInfo.cs
@@ -48,11 +48,11 @@ namespace MediaBrowser.Model.LiveTv
/// <value><c>true</c> if this instance is visible; otherwise, <c>false</c>.</value>
public bool IsVisible { get; set; }
- public List<LiveTvTunerInfoDto> Tuners { get; set; }
+ public LiveTvTunerInfoDto[] Tuners { get; set; }
public LiveTvServiceInfo()
{
- Tuners = new List<LiveTvTunerInfoDto>();
+ Tuners = new LiveTvTunerInfoDto[] { };
}
}
}
diff --git a/MediaBrowser.Model/LiveTv/LiveTvTunerInfoDto.cs b/MediaBrowser.Model/LiveTv/LiveTvTunerInfoDto.cs
index 9af96df43..937cef057 100644
--- a/MediaBrowser.Model/LiveTv/LiveTvTunerInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/LiveTvTunerInfoDto.cs
@@ -62,7 +62,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the clients.
/// </summary>
/// <value>The clients.</value>
- public List<string> Clients { get; set; }
+ public string[] Clients { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance can reset.
@@ -72,7 +72,7 @@ namespace MediaBrowser.Model.LiveTv
public LiveTvTunerInfoDto()
{
- Clients = new List<string>();
+ Clients = new string[] { };
}
}
} \ No newline at end of file
diff --git a/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs b/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs
index 388001287..743caa97e 100644
--- a/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs
+++ b/MediaBrowser.Model/LiveTv/SeriesTimerInfoDto.cs
@@ -15,7 +15,7 @@ namespace MediaBrowser.Model.LiveTv
public SeriesTimerInfoDto()
{
ImageTags = new Dictionary<ImageType, string>();
- Days = new List<DayOfWeek>();
+ Days = new DayOfWeek[] { };
Type = "SeriesTimer";
}
@@ -45,7 +45,7 @@ namespace MediaBrowser.Model.LiveTv
/// Gets or sets the days.
/// </summary>
/// <value>The days.</value>
- public List<DayOfWeek> Days { get; set; }
+ public DayOfWeek[] Days { get; set; }
/// <summary>
/// Gets or sets the day pattern.
@@ -60,16 +60,6 @@ namespace MediaBrowser.Model.LiveTv
public Dictionary<ImageType, string> ImageTags { get; set; }
/// <summary>
- /// Gets a value indicating whether this instance has primary image.
- /// </summary>
- /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
- [IgnoreDataMember]
- public bool HasPrimaryImage
- {
- get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Primary); }
- }
-
- /// <summary>
/// Gets or sets the parent thumb item id.
/// </summary>
/// <value>The parent thumb item id.</value>
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index 0e4cc0623..b36a773eb 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -111,7 +111,6 @@
<Compile Include="Drawing\ImageOrientation.cs" />
<Compile Include="Dto\IHasServerId.cs" />
<Compile Include="Dto\IHasSyncInfo.cs" />
- <Compile Include="Dto\ItemLayout.cs" />
<Compile Include="Dto\MetadataEditorInfo.cs" />
<Compile Include="Dto\NameIdPair.cs" />
<Compile Include="Dto\NameValuePair.cs" />
@@ -127,7 +126,6 @@
<Compile Include="System\IPowerManagement.cs" />
<Compile Include="Text\ITextEncoding.cs" />
<Compile Include="Extensions\LinqExtensions.cs" />
- <Compile Include="Health\IHealthMonitor.cs" />
<Compile Include="IO\FileSystemMetadata.cs" />
<Compile Include="IO\IFileSystem.cs" />
<Compile Include="IO\IMemoryStreamFactory.cs" />
@@ -413,7 +411,6 @@
<Compile Include="Querying\ItemSortBy.cs" />
<Compile Include="Dto\BaseItemDto.cs" />
<Compile Include="Dto\UserDto.cs" />
- <Compile Include="Querying\ItemsResult.cs" />
<Compile Include="Entities\DisplayPreferences.cs" />
<Compile Include="Entities\ImageType.cs" />
<Compile Include="Entities\IHasProviderIds.cs" />
diff --git a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs
index 963e8dd95..1b573fba7 100644
--- a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs
+++ b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs
@@ -12,7 +12,7 @@ namespace MediaBrowser.Model.MediaInfo
/// Gets or sets the media streams.
/// </summary>
/// <value>The media streams.</value>
- public List<MediaStream> MediaStreams { get; set; }
+ public MediaStream[] MediaStreams { get; set; }
/// <summary>
/// Gets or sets the run time ticks.
@@ -24,7 +24,7 @@ namespace MediaBrowser.Model.MediaInfo
/// Gets or sets the files.
/// </summary>
/// <value>The files.</value>
- public List<string> Files { get; set; }
+ public string[] Files { get; set; }
public string PlaylistName { get; set; }
@@ -32,6 +32,6 @@ namespace MediaBrowser.Model.MediaInfo
/// Gets or sets the chapters.
/// </summary>
/// <value>The chapters.</value>
- public List<double> Chapters { get; set; }
+ public double[] Chapters { get; set; }
}
}
diff --git a/MediaBrowser.Model/MediaInfo/MediaInfo.cs b/MediaBrowser.Model/MediaInfo/MediaInfo.cs
index 691dcc6c8..63b1c9cfd 100644
--- a/MediaBrowser.Model/MediaInfo/MediaInfo.cs
+++ b/MediaBrowser.Model/MediaInfo/MediaInfo.cs
@@ -9,7 +9,7 @@ namespace MediaBrowser.Model.MediaInfo
{
private static readonly string[] EmptyStringArray = new string[] { };
- public List<ChapterInfo> Chapters { get; set; }
+ public ChapterInfo[] Chapters { get; set; }
/// <summary>
/// Gets or sets the album.
@@ -20,7 +20,7 @@ namespace MediaBrowser.Model.MediaInfo
/// Gets or sets the artists.
/// </summary>
/// <value>The artists.</value>
- public List<string> Artists { get; set; }
+ public string[] Artists { get; set; }
/// <summary>
/// Gets or sets the album artists.
/// </summary>
@@ -30,13 +30,13 @@ namespace MediaBrowser.Model.MediaInfo
/// Gets or sets the studios.
/// </summary>
/// <value>The studios.</value>
- public List<string> Studios { get; set; }
- public List<string> Genres { get; set; }
+ public string[] Studios { get; set; }
+ public string[] Genres { get; set; }
public int? IndexNumber { get; set; }
public int? ParentIndexNumber { get; set; }
public int? ProductionYear { get; set; }
public DateTime? PremiereDate { get; set; }
- public List<BaseItemPerson> People { get; set; }
+ public BaseItemPerson[] People { get; set; }
public Dictionary<string, string> ProviderIds { get; set; }
/// <summary>
/// Gets or sets the official rating.
@@ -56,12 +56,12 @@ namespace MediaBrowser.Model.MediaInfo
public MediaInfo()
{
- Chapters = new List<ChapterInfo>();
- Artists = new List<string>();
+ Chapters = new ChapterInfo[] { };
+ Artists = new string[] { };
AlbumArtists = EmptyStringArray;
- Studios = new List<string>();
- Genres = new List<string>();
- People = new List<BaseItemPerson>();
+ Studios = new string[] { };
+ Genres = new string[] { };
+ People = new BaseItemPerson[] { };
ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
}
diff --git a/MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs b/MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs
index 1f8936d01..b38fec7d4 100644
--- a/MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs
+++ b/MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs
@@ -10,7 +10,7 @@ namespace MediaBrowser.Model.MediaInfo
/// Gets or sets the media sources.
/// </summary>
/// <value>The media sources.</value>
- public List<MediaSourceInfo> MediaSources { get; set; }
+ public MediaSourceInfo[] MediaSources { get; set; }
/// <summary>
/// Gets or sets the play session identifier.
@@ -26,7 +26,7 @@ namespace MediaBrowser.Model.MediaInfo
public PlaybackInfoResponse()
{
- MediaSources = new List<MediaSourceInfo>();
+ MediaSources = new MediaSourceInfo[] { };
}
}
}
diff --git a/MediaBrowser.Model/MediaInfo/SubtitleTrackInfo.cs b/MediaBrowser.Model/MediaInfo/SubtitleTrackInfo.cs
index 765cfe32f..d3a3bb1d0 100644
--- a/MediaBrowser.Model/MediaInfo/SubtitleTrackInfo.cs
+++ b/MediaBrowser.Model/MediaInfo/SubtitleTrackInfo.cs
@@ -4,11 +4,11 @@ namespace MediaBrowser.Model.MediaInfo
{
public class SubtitleTrackInfo
{
- public List<SubtitleTrackEvent> TrackEvents { get; set; }
+ public SubtitleTrackEvent[] TrackEvents { get; set; }
public SubtitleTrackInfo()
{
- TrackEvents = new List<SubtitleTrackEvent>();
+ TrackEvents = new SubtitleTrackEvent[] { };
}
}
}
diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs
index 7a2e1f215..c4dfd25ca 100644
--- a/MediaBrowser.Model/Net/MimeTypes.cs
+++ b/MediaBrowser.Model/Net/MimeTypes.cs
@@ -14,7 +14,7 @@ namespace MediaBrowser.Model.Net
/// <summary>
/// Any extension in this list is considered a video file - can be added to at runtime for extensibility
/// </summary>
- private static readonly List<string> VideoFileExtensions = new List<string>
+ private static readonly string[] VideoFileExtensions = new string[]
{
".mkv",
".m2t",
diff --git a/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs b/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs
index 59b39fbc7..ee5101011 100644
--- a/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs
+++ b/MediaBrowser.Model/Notifications/NotificationTypeInfo.cs
@@ -18,11 +18,11 @@ namespace MediaBrowser.Model.Notifications
public string DefaultDescription { get; set; }
- public List<string> Variables { get; set; }
+ public string[] Variables { get; set; }
public NotificationTypeInfo()
{
- Variables = new List<string>();
+ Variables = new string[] { };
}
}
} \ No newline at end of file
diff --git a/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs b/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs
index 63deb19dc..5314e791a 100644
--- a/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs
+++ b/MediaBrowser.Model/Playlists/PlaylistCreationRequest.cs
@@ -6,7 +6,7 @@ namespace MediaBrowser.Model.Playlists
{
public string Name { get; set; }
- public List<string> ItemIdList { get; set; }
+ public string[] ItemIdList { get; set; }
public string MediaType { get; set; }
@@ -14,7 +14,7 @@ namespace MediaBrowser.Model.Playlists
public PlaylistCreationRequest()
{
- ItemIdList = new List<string>();
+ ItemIdList = new string[] { };
}
}
}
diff --git a/MediaBrowser.Model/Providers/ImageProviderInfo.cs b/MediaBrowser.Model/Providers/ImageProviderInfo.cs
index c519d66cb..199552640 100644
--- a/MediaBrowser.Model/Providers/ImageProviderInfo.cs
+++ b/MediaBrowser.Model/Providers/ImageProviderInfo.cs
@@ -14,11 +14,11 @@ namespace MediaBrowser.Model.Providers
/// <value>The name.</value>
public string Name { get; set; }
- public List<ImageType> SupportedImages { get; set; }
+ public ImageType[] SupportedImages { get; set; }
public ImageProviderInfo()
{
- SupportedImages = new List<ImageType>();
+ SupportedImages = new ImageType[] { };
}
}
}
diff --git a/MediaBrowser.Model/Providers/RemoteImageResult.cs b/MediaBrowser.Model/Providers/RemoteImageResult.cs
index 1c60db6ae..7e38badfc 100644
--- a/MediaBrowser.Model/Providers/RemoteImageResult.cs
+++ b/MediaBrowser.Model/Providers/RemoteImageResult.cs
@@ -11,7 +11,7 @@ namespace MediaBrowser.Model.Providers
/// Gets or sets the images.
/// </summary>
/// <value>The images.</value>
- public List<RemoteImageInfo> Images { get; set; }
+ public RemoteImageInfo[] Images { get; set; }
/// <summary>
/// Gets or sets the total record count.
@@ -23,6 +23,6 @@ namespace MediaBrowser.Model.Providers
/// Gets or sets the providers.
/// </summary>
/// <value>The providers.</value>
- public List<string> Providers { get; set; }
+ public string[] Providers { get; set; }
}
}
diff --git a/MediaBrowser.Model/Querying/ItemsResult.cs b/MediaBrowser.Model/Querying/ItemsResult.cs
deleted file mode 100644
index 3b9c59733..000000000
--- a/MediaBrowser.Model/Querying/ItemsResult.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using MediaBrowser.Model.Dto;
-
-namespace MediaBrowser.Model.Querying
-{
- /// <summary>
- /// Represents the result of a query for items
- /// </summary>
- public class ItemsResult : QueryResult<BaseItemDto>
- {
- }
-}
diff --git a/MediaBrowser.Model/Querying/QueryResult.cs b/MediaBrowser.Model/Querying/QueryResult.cs
index 1ecc1de6c..6f9923d08 100644
--- a/MediaBrowser.Model/Querying/QueryResult.cs
+++ b/MediaBrowser.Model/Querying/QueryResult.cs
@@ -15,9 +15,6 @@ namespace MediaBrowser.Model.Querying
/// <value>The total record count.</value>
public int TotalRecordCount { get; set; }
- /// <summary>
- /// Initializes a new instance of the <see cref="ItemsResult" /> class.
- /// </summary>
public QueryResult()
{
Items = new T[] { };
diff --git a/MediaBrowser.Model/Querying/ThemeMediaResult.cs b/MediaBrowser.Model/Querying/ThemeMediaResult.cs
index 80478a910..0d7eb502f 100644
--- a/MediaBrowser.Model/Querying/ThemeMediaResult.cs
+++ b/MediaBrowser.Model/Querying/ThemeMediaResult.cs
@@ -1,10 +1,11 @@
-
+using MediaBrowser.Model.Dto;
+
namespace MediaBrowser.Model.Querying
{
/// <summary>
/// Class ThemeMediaResult
/// </summary>
- public class ThemeMediaResult : ItemsResult
+ public class ThemeMediaResult : QueryResult<BaseItemDto>
{
/// <summary>
/// Gets or sets the owner id.
diff --git a/MediaBrowser.Model/Services/QueryParamCollection.cs b/MediaBrowser.Model/Services/QueryParamCollection.cs
index a3e00f587..e13e5feca 100644
--- a/MediaBrowser.Model/Services/QueryParamCollection.cs
+++ b/MediaBrowser.Model/Services/QueryParamCollection.cs
@@ -58,9 +58,7 @@ namespace MediaBrowser.Model.Services
{
if (string.IsNullOrWhiteSpace(value))
{
- var stringComparison = GetStringComparison();
-
- var parameters = this.Where(p => string.Equals(key, p.Name, stringComparison)).ToArray();
+ var parameters = GetItems(key);
foreach (var p in parameters)
{
@@ -85,14 +83,6 @@ namespace MediaBrowser.Model.Services
}
/// <summary>
- /// True if the collection contains a query parameter with the given name.
- /// </summary>
- public bool ContainsKey(string name)
- {
- return this.Any(p => p.Name == name);
- }
-
- /// <summary>
/// Removes all parameters of the given name.
/// </summary>
/// <returns>The number of parameters that were removed</returns>
@@ -106,16 +96,49 @@ namespace MediaBrowser.Model.Services
{
var stringComparison = GetStringComparison();
- return this.Where(p => string.Equals(p.Name, name, stringComparison))
- .Select(p => p.Value)
- .FirstOrDefault();
+ foreach (var pair in this)
+ {
+ if (string.Equals(pair.Name, name, stringComparison))
+ {
+ return pair.Value;
+ }
+ }
+
+ return null;
+ }
+
+ public virtual List<NameValuePair> GetItems(string name)
+ {
+ var stringComparison = GetStringComparison();
+
+ var list = new List<NameValuePair>();
+
+ foreach (var pair in this)
+ {
+ if (string.Equals(pair.Name, name, stringComparison))
+ {
+ list.Add(pair);
+ }
+ }
+
+ return list;
}
- public virtual string[] GetValues(string name)
+ public virtual List<string> GetValues(string name)
{
var stringComparison = GetStringComparison();
- return this.Where(p => string.Equals(p.Name, name, stringComparison)).Select(p => p.Value).ToArray();
+ var list = new List<string>();
+
+ foreach (var pair in this)
+ {
+ if (string.Equals(pair.Name, name, stringComparison))
+ {
+ list.Add(pair.Value);
+ }
+ }
+
+ return list;
}
public Dictionary<string, string> ToDictionary()
@@ -134,7 +157,17 @@ namespace MediaBrowser.Model.Services
public IEnumerable<string> Keys
{
- get { return this.Select(i => i.Name); }
+ get
+ {
+ var keys = new string[this.Count];
+
+ for (var i = 0; i < keys.Length; i++)
+ {
+ keys[i] = this[i].Name;
+ }
+
+ return keys;
+ }
}
/// <summary>
diff --git a/MediaBrowser.Model/Session/ClientCapabilities.cs b/MediaBrowser.Model/Session/ClientCapabilities.cs
index 222c1bd64..9ae1fae9f 100644
--- a/MediaBrowser.Model/Session/ClientCapabilities.cs
+++ b/MediaBrowser.Model/Session/ClientCapabilities.cs
@@ -5,9 +5,9 @@ namespace MediaBrowser.Model.Session
{
public class ClientCapabilities
{
- public List<string> PlayableMediaTypes { get; set; }
+ public string[] PlayableMediaTypes { get; set; }
- public List<string> SupportedCommands { get; set; }
+ public string[] SupportedCommands { get; set; }
public bool SupportsMediaControl { get; set; }
public bool SupportsContentUploading { get; set; }
@@ -17,17 +17,17 @@ namespace MediaBrowser.Model.Session
public bool SupportsSync { get; set; }
public DeviceProfile DeviceProfile { get; set; }
- public List<string> SupportedLiveMediaTypes { get; set; }
+ public string[] SupportedLiveMediaTypes { get; set; }
public string AppStoreUrl { get; set; }
public string IconUrl { get; set; }
public ClientCapabilities()
{
- PlayableMediaTypes = new List<string>();
- SupportedCommands = new List<string>();
+ PlayableMediaTypes = new string[] { };
+ SupportedCommands = new string[] { };
SupportsPersistentIdentifier = true;
- SupportedLiveMediaTypes = new List<string>();
+ SupportedLiveMediaTypes = new string[] { };
}
}
} \ No newline at end of file
diff --git a/MediaBrowser.Model/Session/SessionInfoDto.cs b/MediaBrowser.Model/Session/SessionInfoDto.cs
index 3081d7ee3..78ee72f61 100644
--- a/MediaBrowser.Model/Session/SessionInfoDto.cs
+++ b/MediaBrowser.Model/Session/SessionInfoDto.cs
@@ -12,13 +12,13 @@ namespace MediaBrowser.Model.Session
/// Gets or sets the supported commands.
/// </summary>
/// <value>The supported commands.</value>
- public List<string> SupportedCommands { get; set; }
+ public string[] SupportedCommands { get; set; }
/// <summary>
/// Gets or sets the playable media types.
/// </summary>
/// <value>The playable media types.</value>
- public List<string> PlayableMediaTypes { get; set; }
+ public string[] PlayableMediaTypes { get; set; }
/// <summary>
/// Gets or sets the id.
@@ -50,7 +50,7 @@ namespace MediaBrowser.Model.Session
/// Gets or sets the additional users present.
/// </summary>
/// <value>The additional users present.</value>
- public List<SessionUserInfo> AdditionalUsers { get; set; }
+ public SessionUserInfo[] AdditionalUsers { get; set; }
/// <summary>
/// Gets or sets the application version.
@@ -112,10 +112,10 @@ namespace MediaBrowser.Model.Session
public SessionInfoDto()
{
- AdditionalUsers = new List<SessionUserInfo>();
+ AdditionalUsers = new SessionUserInfo[] { };
- PlayableMediaTypes = new List<string>();
- SupportedCommands = new List<string>();
+ PlayableMediaTypes = new string[] { };
+ SupportedCommands = new string[] { };
}
}
}
diff --git a/MediaBrowser.Model/Session/TranscodingInfo.cs b/MediaBrowser.Model/Session/TranscodingInfo.cs
index f58e605b2..70c299bc2 100644
--- a/MediaBrowser.Model/Session/TranscodingInfo.cs
+++ b/MediaBrowser.Model/Session/TranscodingInfo.cs
@@ -18,11 +18,11 @@ namespace MediaBrowser.Model.Session
public int? Height { get; set; }
public int? AudioChannels { get; set; }
- public List<TranscodeReason> TranscodeReasons { get; set; }
+ public TranscodeReason[] TranscodeReasons { get; set; }
public TranscodingInfo()
{
- TranscodeReasons = new List<TranscodeReason>();
+ TranscodeReasons = new TranscodeReason[] { };
}
}
diff --git a/MediaBrowser.Model/Session/UserDataChangeInfo.cs b/MediaBrowser.Model/Session/UserDataChangeInfo.cs
index f92f44586..c6b03200d 100644
--- a/MediaBrowser.Model/Session/UserDataChangeInfo.cs
+++ b/MediaBrowser.Model/Session/UserDataChangeInfo.cs
@@ -18,6 +18,6 @@ namespace MediaBrowser.Model.Session
/// Gets or sets the user data list.
/// </summary>
/// <value>The user data list.</value>
- public List<UserItemDataDto> UserDataList { get; set; }
+ public UserItemDataDto[] UserDataList { get; set; }
}
}
diff --git a/MediaBrowser.Model/Social/ISharingManager.cs b/MediaBrowser.Model/Social/ISharingManager.cs
index 94c22baba..28c8c7db2 100644
--- a/MediaBrowser.Model/Social/ISharingManager.cs
+++ b/MediaBrowser.Model/Social/ISharingManager.cs
@@ -22,6 +22,6 @@ namespace MediaBrowser.Model.Social
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>Task.</returns>
- Task DeleteShare(string id);
+ void DeleteShare(string id);
}
}
diff --git a/MediaBrowser.Model/Social/ISharingRepository.cs b/MediaBrowser.Model/Social/ISharingRepository.cs
index 1dadd7f71..dd88ddd04 100644
--- a/MediaBrowser.Model/Social/ISharingRepository.cs
+++ b/MediaBrowser.Model/Social/ISharingRepository.cs
@@ -1,11 +1,10 @@
-using System.Threading.Tasks;
-
+
namespace MediaBrowser.Model.Social
{
public interface ISharingRepository
{
- Task CreateShare(SocialShareInfo info);
- Task DeleteShare(string id);
+ void CreateShare(SocialShareInfo info);
+ void DeleteShare(string id);
SocialShareInfo GetShareInfo(string id);
}
}
diff --git a/MediaBrowser.Model/Sync/CompleteSyncJobInfo.cs b/MediaBrowser.Model/Sync/CompleteSyncJobInfo.cs
index 52d3fab3c..adfb84b05 100644
--- a/MediaBrowser.Model/Sync/CompleteSyncJobInfo.cs
+++ b/MediaBrowser.Model/Sync/CompleteSyncJobInfo.cs
@@ -5,11 +5,11 @@ namespace MediaBrowser.Model.Sync
public class CompleteSyncJobInfo
{
public SyncJob Job { get; set; }
- public List<SyncJobItem> JobItems { get; set; }
+ public SyncJobItem[] JobItems { get; set; }
public CompleteSyncJobInfo()
{
- JobItems = new List<SyncJobItem>();
+ JobItems = new SyncJobItem[] { };
}
}
}
diff --git a/MediaBrowser.Model/Sync/LocalItem.cs b/MediaBrowser.Model/Sync/LocalItem.cs
index c5728ac97..3d625aa99 100644
--- a/MediaBrowser.Model/Sync/LocalItem.cs
+++ b/MediaBrowser.Model/Sync/LocalItem.cs
@@ -44,17 +44,17 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the user ids with access.
/// </summary>
/// <value>The user ids with access.</value>
- public List<string> UserIdsWithAccess { get; set; }
+ public string[] UserIdsWithAccess { get; set; }
/// <summary>
/// Gets or sets the additional files.
/// </summary>
/// <value>The additional files.</value>
- public List<string> AdditionalFiles { get; set; }
+ public string[] AdditionalFiles { get; set; }
public LocalItem()
{
- AdditionalFiles = new List<string>();
- UserIdsWithAccess = new List<string>();
+ AdditionalFiles = new string[] { };
+ UserIdsWithAccess = new string[] { };
}
}
}
diff --git a/MediaBrowser.Model/Sync/SyncDataRequest.cs b/MediaBrowser.Model/Sync/SyncDataRequest.cs
index 0df4de86d..79d1842e1 100644
--- a/MediaBrowser.Model/Sync/SyncDataRequest.cs
+++ b/MediaBrowser.Model/Sync/SyncDataRequest.cs
@@ -1,19 +1,16 @@
-using System.Collections.Generic;
-
+
namespace MediaBrowser.Model.Sync
{
public class SyncDataRequest
{
- public List<string> LocalItemIds { get; set; }
- public List<string> OfflineUserIds { get; set; }
- public List<string> SyncJobItemIds { get; set; }
+ public string[] LocalItemIds { get; set; }
+ public string[] SyncJobItemIds { get; set; }
public string TargetId { get; set; }
public SyncDataRequest()
{
- LocalItemIds = new List<string>();
- OfflineUserIds = new List<string>();
+ LocalItemIds = new string[] { };
}
}
}
diff --git a/MediaBrowser.Model/Sync/SyncDataResponse.cs b/MediaBrowser.Model/Sync/SyncDataResponse.cs
index 3799e9455..0b017af6e 100644
--- a/MediaBrowser.Model/Sync/SyncDataResponse.cs
+++ b/MediaBrowser.Model/Sync/SyncDataResponse.cs
@@ -1,16 +1,13 @@
-using System.Collections.Generic;
-
+
namespace MediaBrowser.Model.Sync
{
public class SyncDataResponse
{
- public List<string> ItemIdsToRemove { get; set; }
- public Dictionary<string, List<string>> ItemUserAccess { get; set; }
+ public string[] ItemIdsToRemove { get; set; }
public SyncDataResponse()
{
- ItemIdsToRemove = new List<string>();
- ItemUserAccess = new Dictionary<string, List<string>>();
+ ItemIdsToRemove = new string[] { };
}
}
}
diff --git a/MediaBrowser.Model/Sync/SyncDialogOptions.cs b/MediaBrowser.Model/Sync/SyncDialogOptions.cs
index a987a6cd6..e55ca4f08 100644
--- a/MediaBrowser.Model/Sync/SyncDialogOptions.cs
+++ b/MediaBrowser.Model/Sync/SyncDialogOptions.cs
@@ -8,29 +8,29 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the targets.
/// </summary>
/// <value>The targets.</value>
- public List<SyncTarget> Targets { get; set; }
+ public SyncTarget[] Targets { get; set; }
/// <summary>
/// Gets or sets the options.
/// </summary>
/// <value>The options.</value>
- public List<SyncJobOption> Options { get; set; }
+ public SyncJobOption[] Options { get; set; }
/// <summary>
/// Gets or sets the quality options.
/// </summary>
/// <value>The quality options.</value>
- public List<SyncQualityOption> QualityOptions { get; set; }
+ public SyncQualityOption[] QualityOptions { get; set; }
/// <summary>
/// Gets or sets the profile options.
/// </summary>
/// <value>The profile options.</value>
- public List<SyncProfileOption> ProfileOptions { get; set; }
+ public SyncProfileOption[] ProfileOptions { get; set; }
public SyncDialogOptions()
{
- Targets = new List<SyncTarget>();
- Options = new List<SyncJobOption>();
- QualityOptions = new List<SyncQualityOption>();
- ProfileOptions = new List<SyncProfileOption>();
+ Targets = new SyncTarget[] { };
+ Options = new SyncJobOption[] { };
+ QualityOptions = new SyncQualityOption[] { };
+ ProfileOptions = new SyncProfileOption[] { };
}
}
}
diff --git a/MediaBrowser.Model/Sync/SyncJob.cs b/MediaBrowser.Model/Sync/SyncJob.cs
index eb153427c..e8b698f62 100644
--- a/MediaBrowser.Model/Sync/SyncJob.cs
+++ b/MediaBrowser.Model/Sync/SyncJob.cs
@@ -84,7 +84,7 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the requested item ids.
/// </summary>
/// <value>The requested item ids.</value>
- public List<string> RequestedItemIds { get; set; }
+ public string[] RequestedItemIds { get; set; }
/// <summary>
/// Gets or sets the date created.
/// </summary>
@@ -107,7 +107,7 @@ namespace MediaBrowser.Model.Sync
public SyncJob()
{
- RequestedItemIds = new List<string>();
+ RequestedItemIds = new string[] { };
}
}
}
diff --git a/MediaBrowser.Model/Sync/SyncJobCreationResult.cs b/MediaBrowser.Model/Sync/SyncJobCreationResult.cs
index 6723aa2cf..ee46bc155 100644
--- a/MediaBrowser.Model/Sync/SyncJobCreationResult.cs
+++ b/MediaBrowser.Model/Sync/SyncJobCreationResult.cs
@@ -5,11 +5,11 @@ namespace MediaBrowser.Model.Sync
public class SyncJobCreationResult
{
public SyncJob Job { get; set; }
- public List<SyncJobItem> JobItems { get; set; }
+ public SyncJobItem[] JobItems { get; set; }
public SyncJobCreationResult()
{
- JobItems = new List<SyncJobItem>();
+ JobItems = new SyncJobItem[] { };
}
}
}
diff --git a/MediaBrowser.Model/Sync/SyncJobItem.cs b/MediaBrowser.Model/Sync/SyncJobItem.cs
index 9fb275823..5a97bc92e 100644
--- a/MediaBrowser.Model/Sync/SyncJobItem.cs
+++ b/MediaBrowser.Model/Sync/SyncJobItem.cs
@@ -90,7 +90,7 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the additional files.
/// </summary>
/// <value>The additional files.</value>
- public List<ItemFileInfo> AdditionalFiles { get; set; }
+ public ItemFileInfo[] AdditionalFiles { get; set; }
/// <summary>
/// Gets or sets the index of the job item.
/// </summary>
@@ -101,7 +101,7 @@ namespace MediaBrowser.Model.Sync
public SyncJobItem()
{
- AdditionalFiles = new List<ItemFileInfo>();
+ AdditionalFiles = new ItemFileInfo[] { };
}
}
}
diff --git a/MediaBrowser.Model/Sync/SyncJobRequest.cs b/MediaBrowser.Model/Sync/SyncJobRequest.cs
index a96c86ed9..3dc863b75 100644
--- a/MediaBrowser.Model/Sync/SyncJobRequest.cs
+++ b/MediaBrowser.Model/Sync/SyncJobRequest.cs
@@ -13,7 +13,7 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the item ids.
/// </summary>
/// <value>The item ids.</value>
- public List<string> ItemIds { get; set; }
+ public string[] ItemIds { get; set; }
/// <summary>
/// Gets or sets the category.
/// </summary>
@@ -67,7 +67,7 @@ namespace MediaBrowser.Model.Sync
public SyncJobRequest()
{
- ItemIds = new List<string>();
+ ItemIds = new string[] { };
SyncNewContent = true;
}
}
diff --git a/MediaBrowser.Model/Sync/SyncedItem.cs b/MediaBrowser.Model/Sync/SyncedItem.cs
index 4dedcfd2d..68bd8a2eb 100644
--- a/MediaBrowser.Model/Sync/SyncedItem.cs
+++ b/MediaBrowser.Model/Sync/SyncedItem.cs
@@ -50,11 +50,11 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the additional files.
/// </summary>
/// <value>The additional files.</value>
- public List<ItemFileInfo> AdditionalFiles { get; set; }
+ public ItemFileInfo[] AdditionalFiles { get; set; }
public SyncedItem()
{
- AdditionalFiles = new List<ItemFileInfo>();
+ AdditionalFiles = new ItemFileInfo[] { };
}
}
}
diff --git a/MediaBrowser.Model/System/SystemInfo.cs b/MediaBrowser.Model/System/SystemInfo.cs
index 4154093cb..fce9dea4f 100644
--- a/MediaBrowser.Model/System/SystemInfo.cs
+++ b/MediaBrowser.Model/System/SystemInfo.cs
@@ -46,7 +46,7 @@ namespace MediaBrowser.Model.System
/// Gets or sets the in progress installations.
/// </summary>
/// <value>The in progress installations.</value>
- public List<InstallationInfo> InProgressInstallations { get; set; }
+ public InstallationInfo[] InProgressInstallations { get; set; }
/// <summary>
/// Gets or sets the web socket port number.
@@ -58,7 +58,7 @@ namespace MediaBrowser.Model.System
/// Gets or sets the completed installations.
/// </summary>
/// <value>The completed installations.</value>
- public List<InstallationInfo> CompletedInstallations { get; set; }
+ public InstallationInfo[] CompletedInstallations { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance can self restart.
@@ -76,7 +76,7 @@ namespace MediaBrowser.Model.System
/// Gets or sets plugin assemblies that failed to load.
/// </summary>
/// <value>The failed assembly loads.</value>
- public List<string> FailedPluginAssemblies { get; set; }
+ public string[] FailedPluginAssemblies { get; set; }
/// <summary>
/// Gets or sets the program data path.
@@ -153,11 +153,11 @@ namespace MediaBrowser.Model.System
/// </summary>
public SystemInfo()
{
- InProgressInstallations = new List<InstallationInfo>();
+ InProgressInstallations = new InstallationInfo[] { };
- CompletedInstallations = new List<InstallationInfo>();
+ CompletedInstallations = new InstallationInfo[] { };
- FailedPluginAssemblies = new List<string>();
+ FailedPluginAssemblies = new string[] { };
}
}
}
diff --git a/MediaBrowser.Model/Updates/PackageInfo.cs b/MediaBrowser.Model/Updates/PackageInfo.cs
index 208d5b784..e46d59fc0 100644
--- a/MediaBrowser.Model/Updates/PackageInfo.cs
+++ b/MediaBrowser.Model/Updates/PackageInfo.cs
@@ -151,7 +151,7 @@ namespace MediaBrowser.Model.Updates
/// Gets or sets the versions.
/// </summary>
/// <value>The versions.</value>
- public List<PackageVersionInfo> versions { get; set; }
+ public PackageVersionInfo[] versions { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [enable in application store].
@@ -170,7 +170,7 @@ namespace MediaBrowser.Model.Updates
/// </summary>
public PackageInfo()
{
- versions = new List<PackageVersionInfo>();
+ versions = new PackageVersionInfo[] { };
}
}
}
diff --git a/MediaBrowser.Model/Updates/PackageVersionInfo.cs b/MediaBrowser.Model/Updates/PackageVersionInfo.cs
index 5e0631b3b..3ac518187 100644
--- a/MediaBrowser.Model/Updates/PackageVersionInfo.cs
+++ b/MediaBrowser.Model/Updates/PackageVersionInfo.cs
@@ -89,5 +89,7 @@ namespace MediaBrowser.Model.Updates
public string targetFilename { get; set; }
public string infoUrl { get; set; }
+
+ public string runtimes { get; set; }
}
} \ No newline at end of file