Update to 3.5.2 and .net core 2.1

This commit is contained in:
stefan
2018-09-12 19:26:21 +02:00
parent c32d865638
commit 48facb797e
1419 changed files with 27525 additions and 88927 deletions

View File

@@ -1,68 +0,0 @@
using MediaBrowser.Model.Logging;
using System;
namespace MediaBrowser.Model.Activity
{
public class ActivityLogEntry
{
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public string Id { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the overview.
/// </summary>
/// <value>The overview.</value>
public string Overview { get; set; }
/// <summary>
/// Gets or sets the short overview.
/// </summary>
/// <value>The short overview.</value>
public string ShortOverview { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
public string Type { get; set; }
/// <summary>
/// Gets or sets the item identifier.
/// </summary>
/// <value>The item identifier.</value>
public string ItemId { get; set; }
/// <summary>
/// Gets or sets the date.
/// </summary>
/// <value>The date.</value>
public DateTime Date { get; set; }
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
/// <value>The user identifier.</value>
public string UserId { get; set; }
/// <summary>
/// Gets or sets the user primary image tag.
/// </summary>
/// <value>The user primary image tag.</value>
public string UserPrimaryImageTag { get; set; }
/// <summary>
/// Gets or sets the log severity.
/// </summary>
/// <value>The log severity.</value>
public LogSeverity Severity { get; set; }
}
}

View File

@@ -1,15 +0,0 @@
using System;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Model.Activity
{
public interface IActivityManager
{
event EventHandler<GenericEventArgs<ActivityLogEntry>> EntryCreated;
void Create(ActivityLogEntry entry);
QueryResult<ActivityLogEntry> GetActivityLogEntries(DateTime? minDate, int? startIndex, int? limit);
}
}

View File

@@ -1,12 +0,0 @@
using System;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Model.Activity
{
public interface IActivityRepository
{
void Create(ActivityLogEntry entry);
QueryResult<ActivityLogEntry> GetActivityLogEntries(DateTime? minDate, int? startIndex, int? limit);
}
}

View File

@@ -1,10 +0,0 @@
namespace MediaBrowser.Model.ApiClient
{
public enum ConnectSignupResponse
{
Failure,
Success,
EmailInUse,
UsernameInUser
}
}

View File

@@ -1,22 +0,0 @@
using MediaBrowser.Model.Session;
namespace MediaBrowser.Model.ApiClient
{
/// <summary>
/// Class SystemCommandEventArgs
/// </summary>
public class GeneralCommandEventArgs
{
/// <summary>
/// Gets or sets the command.
/// </summary>
/// <value>The command.</value>
public GeneralCommand Command { get; set; }
/// <summary>
/// Gets or sets the type of the known command.
/// </summary>
/// <value>The type of the known command.</value>
public GeneralCommandType? KnownCommandType { get; set; }
}
}

View File

@@ -1,33 +0,0 @@
using System;
using System.Collections.Generic;
using System.Net;
namespace MediaBrowser.Model.ApiClient
{
/// <summary>
/// Class HttpResponseEventArgs
/// </summary>
public class HttpResponseEventArgs : EventArgs
{
/// <summary>
/// Gets or sets the URL.
/// </summary>
/// <value>The URL.</value>
public string Url { get; set; }
/// <summary>
/// Gets or sets the status code.
/// </summary>
/// <value>The status code.</value>
public HttpStatusCode StatusCode { get; set; }
/// <summary>
/// Gets or sets the headers.
/// </summary>
/// <value>The headers.</value>
public Dictionary<string, string> Headers { get; set; }
public HttpResponseEventArgs()
{
Headers = new Dictionary<string, string>();
}
}
}

View File

@@ -1,27 +0,0 @@

namespace MediaBrowser.Model.ApiClient
{
public class ServerDiscoveryInfo
{
/// <summary>
/// Gets or sets the address.
/// </summary>
/// <value>The address.</value>
public string Address { get; set; }
/// <summary>
/// Gets or sets the server identifier.
/// </summary>
/// <value>The server identifier.</value>
public string Id { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the endpoint address.
/// </summary>
/// <value>The endpoint address.</value>
public string EndpointAddress { get; set; }
}
}

View File

@@ -1,12 +0,0 @@
using MediaBrowser.Model.Session;
namespace MediaBrowser.Model.ApiClient
{
/// <summary>
/// Class SessionUpdatesEventArgs
/// </summary>
public class SessionUpdatesEventArgs
{
public SessionInfoDto[] Sessions { get; set; }
}
}

View File

@@ -1,13 +0,0 @@
namespace MediaBrowser.Model.ApiClient
{
public class WakeOnLanInfo
{
public string MacAddress { get; set; }
public int Port { get; set; }
public WakeOnLanInfo()
{
Port = 9;
}
}
}

View File

@@ -1,17 +0,0 @@

namespace MediaBrowser.Model.Branding
{
public class BrandingOptions
{
/// <summary>
/// Gets or sets the login disclaimer.
/// </summary>
/// <value>The login disclaimer.</value>
public string LoginDisclaimer { get; set; }
/// <summary>
/// Gets or sets the custom CSS.
/// </summary>
/// <value>The custom CSS.</value>
public string CustomCss { get; set; }
}
}

View File

@@ -1,61 +0,0 @@
using System.Collections.Generic;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Model.Channels
{
public class AllChannelMediaQuery
{
/// <summary>
/// Gets or sets the channel ids.
/// </summary>
/// <value>The channel ids.</value>
public string[] ChannelIds { get; set; }
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
/// <value>The user identifier.</value>
public string UserId { get; set; }
/// <summary>
/// Skips over a given number of items within the results. Use for paging.
/// </summary>
/// <value>The start index.</value>
public int? StartIndex { get; set; }
/// <summary>
/// The maximum number of items to return
/// </summary>
/// <value>The limit.</value>
public int? Limit { get; set; }
/// <summary>
/// Gets or sets the content types.
/// </summary>
/// <value>The content types.</value>
public ChannelMediaContentType[] ContentTypes { get; set; }
/// <summary>
/// Gets or sets the extra types.
/// </summary>
/// <value>The extra types.</value>
public ExtraType[] ExtraTypes { get; set; }
public TrailerType[] TrailerTypes { get; set; }
public AllChannelMediaQuery()
{
ChannelIds = new string[] { };
ContentTypes = new ChannelMediaContentType[] { };
ExtraTypes = new ExtraType[] { };
TrailerTypes = new TrailerType[] { };
Filters = new ItemFilter[] { };
Fields = new ItemFields[]{};
}
public ItemFilter[] Filters { get; set; }
public ItemFields[] Fields { get; set; }
}
}

View File

@@ -1,85 +0,0 @@
using System.Collections.Generic;
namespace MediaBrowser.Model.Channels
{
public class ChannelFeatures
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public string Id { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance can search.
/// </summary>
/// <value><c>true</c> if this instance can search; otherwise, <c>false</c>.</value>
public bool CanSearch { get; set; }
/// <summary>
/// Gets or sets the media types.
/// </summary>
/// <value>The media types.</value>
public ChannelMediaType[] MediaTypes { get; set; }
/// <summary>
/// Gets or sets the content types.
/// </summary>
/// <value>The content types.</value>
public ChannelMediaContentType[] ContentTypes { get; set; }
/// <summary>
/// Represents the maximum number of records the channel allows retrieving at a time
/// </summary>
public int? MaxPageSize { get; set; }
/// <summary>
/// Gets or sets the automatic refresh levels.
/// </summary>
/// <value>The automatic refresh levels.</value>
public int? AutoRefreshLevels { get; set; }
/// <summary>
/// Gets or sets the default sort orders.
/// </summary>
/// <value>The default sort orders.</value>
public ChannelItemSortField[] DefaultSortFields { get; set; }
/// <summary>
/// Indicates if a sort ascending/descending toggle is supported or not.
/// </summary>
public bool SupportsSortOrderToggle { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [supports latest media].
/// </summary>
/// <value><c>true</c> if [supports latest media]; otherwise, <c>false</c>.</value>
public bool SupportsLatestMedia { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance can filter.
/// </summary>
/// <value><c>true</c> if this instance can filter; otherwise, <c>false</c>.</value>
public bool CanFilter { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [supports content downloading].
/// </summary>
/// <value><c>true</c> if [supports content downloading]; otherwise, <c>false</c>.</value>
public bool SupportsContentDownloading { get; set; }
public ChannelFeatures()
{
MediaTypes = new ChannelMediaType[] { };
ContentTypes = new ChannelMediaContentType[] { };
DefaultSortFields = new ChannelItemSortField[] { };
}
}
}

View File

@@ -1,17 +0,0 @@
namespace MediaBrowser.Model.Channels
{
public enum ChannelFolderType
{
Container = 0,
MusicAlbum = 1,
PhotoAlbum = 2,
MusicArtist = 3,
Series = 4,
Season = 5
}
}

View File

@@ -1,30 +0,0 @@

namespace MediaBrowser.Model.Channels
{
public class ChannelInfo
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public string Id { get; set; }
/// <summary>
/// Gets or sets the home page URL.
/// </summary>
/// <value>The home page URL.</value>
public string HomePageUrl { get; set; }
/// <summary>
/// Gets or sets the features.
/// </summary>
/// <value>The features.</value>
public ChannelFeatures Features { get; set; }
}
}

View File

@@ -1,52 +0,0 @@
using System;
using System.Collections.Generic;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Model.Channels
{
public class ChannelItemQuery
{
/// <summary>
/// Gets or sets the channel identifier.
/// </summary>
/// <value>The channel identifier.</value>
public string ChannelId { get; set; }
/// <summary>
/// Gets or sets the category identifier.
/// </summary>
/// <value>The category identifier.</value>
public string FolderId { get; set; }
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
/// <value>The user identifier.</value>
public string UserId { get; set; }
/// <summary>
/// Skips over a given number of items within the results. Use for paging.
/// </summary>
/// <value>The start index.</value>
public int? StartIndex { get; set; }
/// <summary>
/// The maximum number of items to return
/// </summary>
/// <value>The limit.</value>
public int? Limit { get; set; }
public ItemFilter[] Filters { get; set; }
public ItemFields[] Fields { get; set; }
public Tuple<string, SortOrder>[] OrderBy { get; set; }
public ChannelItemQuery()
{
Filters = new ItemFilter[] { };
Fields = new ItemFields[] { };
OrderBy = new Tuple<string, SortOrder>[] { };
}
}
}

View File

@@ -1,13 +0,0 @@
namespace MediaBrowser.Model.Channels
{
public enum ChannelItemSortField
{
Name = 0,
CommunityRating = 1,
PremiereDate = 2,
DateCreated = 3,
Runtime = 4,
PlayCount = 5,
CommunityPlayCount = 6
}
}

View File

@@ -1,23 +0,0 @@
namespace MediaBrowser.Model.Channels
{
public enum ChannelMediaContentType
{
Clip = 0,
Podcast = 1,
Trailer = 2,
Movie = 3,
Episode = 4,
Song = 5,
MovieExtra = 6,
TvExtra = 7,
GameExtra = 8
}
}

View File

@@ -1,11 +0,0 @@
namespace MediaBrowser.Model.Channels
{
public enum ChannelMediaType
{
Audio = 0,
Video = 1,
Photo = 2
}
}

View File

@@ -1,47 +0,0 @@
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Model.Channels
{
public class ChannelQuery
{
/// <summary>
/// Fields to return within the items, in addition to basic information
/// </summary>
/// <value>The fields.</value>
public ItemFields[] Fields { get; set; }
public bool? EnableImages { get; set; }
public int? ImageTypeLimit { get; set; }
public ImageType[] EnableImageTypes { get; set; }
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
/// <value>The user identifier.</value>
public string UserId { get; set; }
/// <summary>
/// Skips over a given number of items within the results. Use for paging.
/// </summary>
/// <value>The start index.</value>
public int? StartIndex { get; set; }
/// <summary>
/// The maximum number of items to return
/// </summary>
/// <value>The limit.</value>
public int? Limit { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [supports latest items].
/// </summary>
/// <value><c>true</c> if [supports latest items]; otherwise, <c>false</c>.</value>
public bool? SupportsLatestItems { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is favorite.
/// </summary>
/// <value><c>null</c> if [is favorite] contains no value, <c>true</c> if [is favorite]; otherwise, <c>false</c>.</value>
public bool? IsFavorite { get; set; }
}
}

View File

@@ -1,8 +0,0 @@

namespace MediaBrowser.Model.Collections
{
public class CollectionCreationResult
{
public string Id { get; set; }
}
}

View File

@@ -1,22 +0,0 @@

namespace MediaBrowser.Model.Configuration
{
public class AccessSchedule
{
/// <summary>
/// Gets or sets the day of week.
/// </summary>
/// <value>The day of week.</value>
public DynamicDayOfWeek DayOfWeek { get; set; }
/// <summary>
/// Gets or sets the start hour.
/// </summary>
/// <value>The start hour.</value>
public double StartHour { get; set; }
/// <summary>
/// Gets or sets the end hour.
/// </summary>
/// <value>The end hour.</value>
public double EndHour { get; set; }
}
}

View File

@@ -1,57 +0,0 @@
using MediaBrowser.Model.Updates;
namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Serves as a common base class for the Server and UI application Configurations
/// ProtoInclude tells Protobuf about subclasses,
/// The number 50 can be any number, so long as it doesn't clash with any of the ProtoMember numbers either here or in subclasses.
/// </summary>
public class BaseApplicationConfiguration
{
/// <summary>
/// Gets or sets a value indicating whether [enable debug level logging].
/// </summary>
/// <value><c>true</c> if [enable debug level logging]; otherwise, <c>false</c>.</value>
public bool EnableDebugLevelLogging { get; set; }
/// <summary>
/// Enable automatically and silently updating of the application
/// </summary>
/// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value>
public bool EnableAutoUpdate { get; set; }
/// <summary>
/// The number of days we should retain log files
/// </summary>
/// <value>The log file retention days.</value>
public int LogFileRetentionDays { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [run at startup].
/// </summary>
/// <value><c>true</c> if [run at startup]; otherwise, <c>false</c>.</value>
public bool RunAtStartup { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is first run.
/// </summary>
/// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
public bool IsStartupWizardCompleted { get; set; }
/// <summary>
/// Gets or sets the cache path.
/// </summary>
/// <value>The cache path.</value>
public string CachePath { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="BaseApplicationConfiguration" /> class.
/// </summary>
public BaseApplicationConfiguration()
{
EnableAutoUpdate = true;
LogFileRetentionDays = 3;
}
}
}

View File

@@ -1,8 +0,0 @@
namespace MediaBrowser.Model.Configuration
{
public class ChannelOptions
{
public int? PreferredStreamingWidth { get; set; }
public string DownloadPath { get; set; }
}
}

View File

@@ -1,27 +0,0 @@

namespace MediaBrowser.Model.Configuration
{
public class CinemaModeConfiguration
{
public bool EnableIntrosForMovies { get; set; }
public bool EnableIntrosForEpisodes { get; set; }
public bool EnableIntrosForWatchedContent { get; set; }
public bool EnableIntrosFromUpcomingTrailers { get; set; }
public bool EnableIntrosFromMoviesInLibrary { get; set; }
public bool EnableIntrosParentalControl { get; set; }
public bool EnableIntrosFromSimilarMovies { get; set; }
public string CustomIntroPath { get; set; }
public string MediaInfoIntroPath { get; set; }
public bool EnableIntrosFromUpcomingDvdMovies { get; set; }
public bool EnableIntrosFromUpcomingStreamingMovies { get; set; }
public int TrailerLimit { get; set; }
public CinemaModeConfiguration()
{
EnableIntrosParentalControl = true;
EnableIntrosFromSimilarMovies = true;
TrailerLimit = 2;
}
}
}

View File

@@ -1,23 +0,0 @@

namespace MediaBrowser.Model.Configuration
{
public class DlnaOptions
{
public bool EnablePlayTo { get; set; }
public bool EnableServer { get; set; }
public bool EnableDebugLog { get; set; }
public bool BlastAliveMessages { get; set; }
public int ClientDiscoveryIntervalSeconds { get; set; }
public int BlastAliveMessageIntervalSeconds { get; set; }
public string DefaultUserId { get; set; }
public DlnaOptions()
{
EnablePlayTo = true;
EnableServer = true;
BlastAliveMessages = true;
ClientDiscoveryIntervalSeconds = 60;
BlastAliveMessageIntervalSeconds = 30;
}
}
}

View File

@@ -1,17 +0,0 @@

namespace MediaBrowser.Model.Configuration
{
public enum DynamicDayOfWeek
{
Sunday = 0,
Monday = 1,
Tuesday = 2,
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6,
Everyday = 7,
Weekday = 8,
Weekend = 9
}
}

View File

@@ -1,36 +0,0 @@

namespace MediaBrowser.Model.Configuration
{
public class EncodingOptions
{
public int EncodingThreadCount { get; set; }
public string TranscodingTempPath { get; set; }
public double DownMixAudioBoost { get; set; }
public bool EnableThrottling { get; set; }
public int ThrottleDelaySeconds { get; set; }
public string HardwareAccelerationType { get; set; }
public string EncoderAppPath { get; set; }
public string VaapiDevice { get; set; }
public int H264Crf { get; set; }
public string H264Preset { get; set; }
public string DeinterlaceMethod { get; set; }
public bool EnableHardwareEncoding { get; set; }
public bool EnableSubtitleExtraction { get; set; }
public string[] HardwareDecodingCodecs { get; set; }
public EncodingOptions()
{
DownMixAudioBoost = 2;
EnableThrottling = true;
ThrottleDelaySeconds = 180;
EncodingThreadCount = -1;
// This is a DRM device that is almost guaranteed to be there on every intel platform, plus it's the default one in ffmpeg if you don't specify anything
VaapiDevice = "/dev/dri/renderD128";
H264Crf = 23;
EnableHardwareEncoding = true;
EnableSubtitleExtraction = true;
HardwareDecodingCodecs = new string[] { "h264", "vc1" };
}
}
}

View File

@@ -1,12 +0,0 @@

namespace MediaBrowser.Model.Configuration
{
public class FanartOptions
{
/// <summary>
/// Gets or sets the user API key.
/// </summary>
/// <value>The user API key.</value>
public string UserApiKey { get; set; }
}
}

View File

@@ -1,29 +0,0 @@
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Configuration
{
public class ImageOption
{
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
public ImageType Type { get; set; }
/// <summary>
/// Gets or sets the limit.
/// </summary>
/// <value>The limit.</value>
public int Limit { get; set; }
/// <summary>
/// Gets or sets the minimum width.
/// </summary>
/// <value>The minimum width.</value>
public int MinWidth { get; set; }
public ImageOption()
{
Limit = 1;
}
}
}

View File

@@ -1,8 +0,0 @@
namespace MediaBrowser.Model.Configuration
{
public enum ImageSavingConvention
{
Legacy,
Compatible
}
}

View File

@@ -1,51 +0,0 @@
namespace MediaBrowser.Model.Configuration
{
public class LibraryOptions
{
public bool EnableArchiveMediaFiles { get; set; }
public bool EnablePhotos { get; set; }
public bool EnableRealtimeMonitor { get; set; }
public bool EnableChapterImageExtraction { get; set; }
public bool ExtractChapterImagesDuringLibraryScan { get; set; }
public bool DownloadImagesInAdvance { get; set; }
public MediaPathInfo[] PathInfos { get; set; }
public bool SaveLocalMetadata { get; set; }
public bool EnableInternetProviders { get; set; }
public bool ImportMissingEpisodes { get; set; }
public bool EnableAutomaticSeriesGrouping { get; set; }
public bool EnableEmbeddedTitles { get; set; }
public int AutomaticRefreshIntervalDays { get; set; }
/// <summary>
/// Gets or sets the preferred metadata language.
/// </summary>
/// <value>The preferred metadata language.</value>
public string PreferredMetadataLanguage { get; set; }
/// <summary>
/// Gets or sets the metadata country code.
/// </summary>
/// <value>The metadata country code.</value>
public string MetadataCountryCode { get; set; }
public string SeasonZeroDisplayName { get; set; }
public LibraryOptions()
{
EnablePhotos = true;
EnableRealtimeMonitor = true;
PathInfos = new MediaPathInfo[] { };
EnableInternetProviders = true;
EnableAutomaticSeriesGrouping = true;
SeasonZeroDisplayName = "Specials";
}
}
public class MediaPathInfo
{
public string Path { get; set; }
public string NetworkPath { get; set; }
}
}

View File

@@ -1,13 +0,0 @@

namespace MediaBrowser.Model.Configuration
{
public class MetadataConfiguration
{
public bool UseFileCreationTimeForDateAdded { get; set; }
public MetadataConfiguration()
{
UseFileCreationTimeForDateAdded = true;
}
}
}

View File

@@ -1,91 +0,0 @@
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Extensions;
using System.Collections.Generic;
namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Class MetadataOptions.
/// </summary>
public class MetadataOptions
{
public string ItemType { get; set; }
public ImageOption[] ImageOptions { get; set; }
public string[] DisabledMetadataSavers { get; set; }
public string[] LocalMetadataReaderOrder { get; set; }
public string[] DisabledMetadataFetchers { get; set; }
public string[] MetadataFetcherOrder { get; set; }
public string[] DisabledImageFetchers { get; set; }
public string[] ImageFetcherOrder { get; set; }
public MetadataOptions()
: this(3, 1280)
{
}
public MetadataOptions(int backdropLimit, int minBackdropWidth)
{
ImageOptions = new[]
{
new ImageOption
{
Limit = backdropLimit,
MinWidth = minBackdropWidth,
Type = ImageType.Backdrop
}
};
DisabledMetadataSavers = new string[] { };
LocalMetadataReaderOrder = new string[] { };
DisabledMetadataFetchers = new string[] { };
MetadataFetcherOrder = new string[] { };
DisabledImageFetchers = new string[] { };
ImageFetcherOrder = new string[] { };
}
public int GetLimit(ImageType type)
{
ImageOption option = null;
foreach (ImageOption i in ImageOptions)
{
if (i.Type == type)
{
option = i;
break;
}
}
return option == null ? 1 : option.Limit;
}
public int GetMinWidth(ImageType type)
{
ImageOption option = null;
foreach (ImageOption i in ImageOptions)
{
if (i.Type == type)
{
option = i;
break;
}
}
return option == null ? 0 : option.MinWidth;
}
public bool IsEnabled(ImageType type)
{
return GetLimit(type) > 0;
}
public bool IsMetadataSaverEnabled(string name)
{
return !ListHelper.ContainsIgnoreCase(DisabledMetadataSavers, name);
}
}
}

View File

@@ -1,17 +0,0 @@
namespace MediaBrowser.Model.Configuration
{
public class MetadataPlugin
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
public MetadataPluginType Type { get; set; }
}
}

View File

@@ -1,32 +0,0 @@
using System.Collections.Generic;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Configuration
{
public class MetadataPluginSummary
{
/// <summary>
/// Gets or sets the type of the item.
/// </summary>
/// <value>The type of the item.</value>
public string ItemType { get; set; }
/// <summary>
/// Gets or sets the plugins.
/// </summary>
/// <value>The plugins.</value>
public MetadataPlugin[] Plugins { get; set; }
/// <summary>
/// Gets or sets the supported image types.
/// </summary>
/// <value>The supported image types.</value>
public ImageType[] SupportedImageTypes { get; set; }
public MetadataPluginSummary()
{
SupportedImageTypes = new ImageType[] { };
Plugins = new MetadataPlugin[] { };
}
}
}

View File

@@ -1,15 +0,0 @@
namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Enum MetadataPluginType
/// </summary>
public enum MetadataPluginType
{
LocalImageProvider,
ImageFetcher,
ImageSaver,
LocalMetadataProvider,
MetadataFetcher,
MetadataSaver
}
}

View File

@@ -1,574 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Represents the server configuration.
/// </summary>
public class ServerConfiguration : BaseApplicationConfiguration
{
public const int DefaultHttpPort = 8096;
public const int DefaultHttpsPort = 8920;
/// <summary>
/// Gets or sets a value indicating whether [enable u pn p].
/// </summary>
/// <value><c>true</c> if [enable u pn p]; otherwise, <c>false</c>.</value>
public bool EnableUPnP { get; set; }
/// <summary>
/// Gets or sets the public mapped port.
/// </summary>
/// <value>The public mapped port.</value>
public int PublicPort { get; set; }
/// <summary>
/// Gets or sets the public HTTPS port.
/// </summary>
/// <value>The public HTTPS port.</value>
public int PublicHttpsPort { get; set; }
/// <summary>
/// Gets or sets the HTTP server port number.
/// </summary>
/// <value>The HTTP server port number.</value>
public int HttpServerPortNumber { get; set; }
/// <summary>
/// Gets or sets the HTTPS server port number.
/// </summary>
/// <value>The HTTPS server port number.</value>
public int HttpsPortNumber { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [use HTTPS].
/// </summary>
/// <value><c>true</c> if [use HTTPS]; otherwise, <c>false</c>.</value>
public bool EnableHttps { get; set; }
public bool EnableNormalizedItemByNameIds { get; set; }
/// <summary>
/// Gets or sets the value pointing to the file system where the ssl certiifcate is located..
/// </summary>
/// <value>The value pointing to the file system where the ssl certiifcate is located..</value>
public string CertificatePath { get; set; }
public string CertificatePassword { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance is port authorized.
/// </summary>
/// <value><c>true</c> if this instance is port authorized; otherwise, <c>false</c>.</value>
public bool IsPortAuthorized { get; set; }
public bool AutoRunWebApp { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [enable case sensitive item ids].
/// </summary>
/// <value><c>true</c> if [enable case sensitive item ids]; otherwise, <c>false</c>.</value>
public bool EnableCaseSensitiveItemIds { get; set; }
public bool DisableLiveTvChannelUserDataName { get; set; }
/// <summary>
/// Gets or sets the metadata path.
/// </summary>
/// <value>The metadata path.</value>
public string MetadataPath { get; set; }
public string MetadataNetworkPath { get; set; }
/// <summary>
/// Gets or sets the preferred metadata language.
/// </summary>
/// <value>The preferred metadata language.</value>
public string PreferredMetadataLanguage { get; set; }
/// <summary>
/// Gets or sets the metadata country code.
/// </summary>
/// <value>The metadata country code.</value>
public string MetadataCountryCode { get; set; }
/// <summary>
/// Characters to be replaced with a ' ' in strings to create a sort name
/// </summary>
/// <value>The sort replace characters.</value>
public string[] SortReplaceCharacters { get; set; }
/// <summary>
/// Characters to be removed from strings to create a sort name
/// </summary>
/// <value>The sort remove characters.</value>
public string[] SortRemoveCharacters { get; set; }
/// <summary>
/// Words to be removed from strings to create a sort name
/// </summary>
/// <value>The sort remove words.</value>
public string[] SortRemoveWords { get; set; }
/// <summary>
/// Gets or sets the minimum percentage of an item that must be played in order for playstate to be updated.
/// </summary>
/// <value>The min resume PCT.</value>
public int MinResumePct { get; set; }
/// <summary>
/// Gets or sets the maximum percentage of an item that can be played while still saving playstate. If this percentage is crossed playstate will be reset to the beginning and the item will be marked watched.
/// </summary>
/// <value>The max resume PCT.</value>
public int MaxResumePct { get; set; }
/// <summary>
/// Gets or sets the minimum duration that an item must have in order to be eligible for playstate updates..
/// </summary>
/// <value>The min resume duration seconds.</value>
public int MinResumeDurationSeconds { get; set; }
/// <summary>
/// The delay in seconds that we will wait after a file system change to try and discover what has been added/removed
/// Some delay is necessary with some items because their creation is not atomic. It involves the creation of several
/// different directories and files.
/// </summary>
/// <value>The file watcher delay.</value>
public int LibraryMonitorDelay { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [enable dashboard response caching].
/// Allows potential contributors without visual studio to modify production dashboard code and test changes.
/// </summary>
/// <value><c>true</c> if [enable dashboard response caching]; otherwise, <c>false</c>.</value>
public bool EnableDashboardResponseCaching { get; set; }
/// <summary>
/// Allows the dashboard to be served from a custom path.
/// </summary>
/// <value>The dashboard source path.</value>
public string DashboardSourcePath { get; set; }
/// <summary>
/// Gets or sets the image saving convention.
/// </summary>
/// <value>The image saving convention.</value>
public ImageSavingConvention ImageSavingConvention { get; set; }
public MetadataOptions[] MetadataOptions { get; set; }
public bool EnableAutomaticRestart { get; set; }
public bool SkipDeserializationForBasicTypes { get; set; }
public string ServerName { get; set; }
public string WanDdns { get; set; }
public string UICulture { get; set; }
public bool SaveMetadataHidden { get; set; }
public NameValuePair[] ContentTypes { get; set; }
public int RemoteClientBitrateLimit { get; set; }
public int SharingExpirationDays { get; set; }
public int SchemaVersion { get; set; }
public bool EnableAnonymousUsageReporting { get; set; }
public bool EnableFolderView { get; set; }
public bool EnableGroupingIntoCollections { get; set; }
public bool DisplaySpecialsWithinSeasons { get; set; }
public bool DisplayCollectionsView { get; set; }
public string[] LocalNetworkAddresses { get; set; }
public string[] CodecsUsed { get; set; }
public bool EnableChannelView { get; set; }
public bool EnableExternalContentInSuggestions { get; set; }
public bool RequireHttps { get; set; }
public bool IsBehindProxy { get; set; }
public bool EnableNewOmdbSupport { get; set; }
public int ImageExtractionTimeoutMs { get; set; }
public PathSubstitution[] PathSubstitutions { get; set; }
public bool EnableSimpleArtistDetection { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
/// </summary>
public ServerConfiguration()
{
LocalNetworkAddresses = new string[] { };
CodecsUsed = new string[] { };
ImageExtractionTimeoutMs = 0;
PathSubstitutions = new PathSubstitution[] { };
EnableSimpleArtistDetection = true;
DisplaySpecialsWithinSeasons = true;
EnableExternalContentInSuggestions = true;
ImageSavingConvention = ImageSavingConvention.Compatible;
PublicPort = DefaultHttpPort;
PublicHttpsPort = DefaultHttpsPort;
HttpServerPortNumber = DefaultHttpPort;
HttpsPortNumber = DefaultHttpsPort;
EnableHttps = false;
EnableDashboardResponseCaching = true;
EnableAnonymousUsageReporting = true;
EnableCaseSensitiveItemIds = true;
EnableAutomaticRestart = true;
EnableUPnP = true;
SharingExpirationDays = 30;
MinResumePct = 5;
MaxResumePct = 90;
// 5 minutes
MinResumeDurationSeconds = 300;
LibraryMonitorDelay = 60;
ContentTypes = new NameValuePair[] { };
PreferredMetadataLanguage = "en";
MetadataCountryCode = "US";
SortReplaceCharacters = new[] { ".", "+", "%" };
SortRemoveCharacters = new[] { ",", "&", "-", "{", "}", "'" };
SortRemoveWords = new[] { "the", "a", "an" };
UICulture = "en-us";
MetadataOptions = new[]
{
new MetadataOptions(1, 1280) {ItemType = "Book"},
new MetadataOptions(1, 1280)
{
ItemType = "Movie",
ImageOptions = new []
{
new ImageOption
{
Limit = 1,
MinWidth = 1280,
Type = ImageType.Backdrop
},
// Don't download this by default as it's rarely used.
new ImageOption
{
Limit = 0,
Type = ImageType.Art
},
// Don't download this by default as it's rarely used.
new ImageOption
{
Limit = 0,
Type = ImageType.Disc
},
new ImageOption
{
Limit = 1,
Type = ImageType.Primary
},
new ImageOption
{
Limit = 0,
Type = ImageType.Banner
},
new ImageOption
{
Limit = 1,
Type = ImageType.Thumb
},
new ImageOption
{
Limit = 1,
Type = ImageType.Logo
}
}
},
new MetadataOptions(1, 1280)
{
ItemType = "MusicVideo",
ImageOptions = new []
{
new ImageOption
{
Limit = 1,
MinWidth = 1280,
Type = ImageType.Backdrop
},
// Don't download this by default as it's rarely used.
new ImageOption
{
Limit = 0,
Type = ImageType.Art
},
// Don't download this by default as it's rarely used.
new ImageOption
{
Limit = 0,
Type = ImageType.Disc
},
new ImageOption
{
Limit = 1,
Type = ImageType.Primary
},
new ImageOption
{
Limit = 0,
Type = ImageType.Banner
},
new ImageOption
{
Limit = 1,
Type = ImageType.Thumb
},
new ImageOption
{
Limit = 1,
Type = ImageType.Logo
}
},
DisabledMetadataFetchers = new []{ "The Open Movie Database" },
DisabledImageFetchers = new []{ "The Open Movie Database", "FanArt" }
},
new MetadataOptions(1, 1280)
{
ItemType = "Series",
ImageOptions = new []
{
new ImageOption
{
Limit = 1,
MinWidth = 1280,
Type = ImageType.Backdrop
},
// Don't download this by default as it's rarely used.
new ImageOption
{
Limit = 0,
Type = ImageType.Art
},
new ImageOption
{
Limit = 1,
Type = ImageType.Primary
},
new ImageOption
{
Limit = 1,
Type = ImageType.Banner
},
new ImageOption
{
Limit = 1,
Type = ImageType.Thumb
},
new ImageOption
{
Limit = 1,
Type = ImageType.Logo
}
},
DisabledMetadataFetchers = new []{ "TheMovieDb" },
DisabledImageFetchers = new []{ "TheMovieDb" }
},
new MetadataOptions(1, 1280)
{
ItemType = "MusicAlbum",
ImageOptions = new []
{
new ImageOption
{
Limit = 0,
MinWidth = 1280,
Type = ImageType.Backdrop
},
// Don't download this by default as it's rarely used.
new ImageOption
{
Limit = 0,
Type = ImageType.Disc
}
},
DisabledMetadataFetchers = new []{ "TheAudioDB" }
},
new MetadataOptions(1, 1280)
{
ItemType = "MusicArtist",
ImageOptions = new []
{
new ImageOption
{
Limit = 1,
MinWidth = 1280,
Type = ImageType.Backdrop
},
// Don't download this by default
// They do look great, but most artists won't have them, which means a banner view isn't really possible
new ImageOption
{
Limit = 0,
Type = ImageType.Banner
},
// Don't download this by default
// Generally not used
new ImageOption
{
Limit = 0,
Type = ImageType.Art
},
new ImageOption
{
Limit = 1,
Type = ImageType.Logo
}
},
DisabledMetadataFetchers = new []{ "TheAudioDB" }
},
new MetadataOptions(1, 1280)
{
ItemType = "BoxSet",
ImageOptions = new []
{
new ImageOption
{
Limit = 1,
MinWidth = 1280,
Type = ImageType.Backdrop
},
new ImageOption
{
Limit = 1,
Type = ImageType.Primary
},
new ImageOption
{
Limit = 1,
Type = ImageType.Thumb
},
new ImageOption
{
Limit = 1,
Type = ImageType.Logo
},
// Don't download this by default as it's rarely used.
new ImageOption
{
Limit = 0,
Type = ImageType.Art
},
// Don't download this by default as it's rarely used.
new ImageOption
{
Limit = 0,
Type = ImageType.Disc
},
// Don't download this by default as it's rarely used.
new ImageOption
{
Limit = 0,
Type = ImageType.Banner
}
}
},
new MetadataOptions(0, 1280)
{
ItemType = "Season",
ImageOptions = new []
{
new ImageOption
{
Limit = 0,
MinWidth = 1280,
Type = ImageType.Backdrop
},
new ImageOption
{
Limit = 1,
Type = ImageType.Primary
},
new ImageOption
{
Limit = 0,
Type = ImageType.Banner
},
new ImageOption
{
Limit = 0,
Type = ImageType.Thumb
}
},
DisabledMetadataFetchers = new []{ "TheMovieDb" },
DisabledImageFetchers = new [] { "FanArt" }
},
new MetadataOptions(0, 1280)
{
ItemType = "Episode",
ImageOptions = new []
{
new ImageOption
{
Limit = 0,
MinWidth = 1280,
Type = ImageType.Backdrop
},
new ImageOption
{
Limit = 1,
Type = ImageType.Primary
}
},
DisabledMetadataFetchers = new []{ "The Open Movie Database", "TheMovieDb" },
DisabledImageFetchers = new []{ "The Open Movie Database", "TheMovieDb" }
}
};
}
}
public class PathSubstitution
{
public string From { get; set; }
public string To { get; set; }
}
}

View File

@@ -1,11 +0,0 @@
namespace MediaBrowser.Model.Configuration
{
public enum SubtitlePlaybackMode
{
Default = 0,
Always = 1,
OnlyForced = 2,
None = 3,
Smart = 4
}
}

View File

@@ -1,16 +0,0 @@
namespace MediaBrowser.Model.Configuration
{
public enum UnratedItem
{
Movie,
Trailer,
Series,
Music,
Game,
Book,
LiveTvChannel,
LiveTvProgram,
ChannelContent,
Other
}
}

View File

@@ -1,64 +0,0 @@

namespace MediaBrowser.Model.Configuration
{
/// <summary>
/// Class UserConfiguration
/// </summary>
public class UserConfiguration
{
/// <summary>
/// Gets or sets the audio language preference.
/// </summary>
/// <value>The audio language preference.</value>
public string AudioLanguagePreference { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [play default audio track].
/// </summary>
/// <value><c>true</c> if [play default audio track]; otherwise, <c>false</c>.</value>
public bool PlayDefaultAudioTrack { get; set; }
/// <summary>
/// Gets or sets the subtitle language preference.
/// </summary>
/// <value>The subtitle language preference.</value>
public string SubtitleLanguagePreference { get; set; }
public bool DisplayMissingEpisodes { get; set; }
public string[] GroupedFolders { get; set; }
public SubtitlePlaybackMode SubtitleMode { get; set; }
public bool DisplayCollectionsView { get; set; }
public bool EnableLocalPassword { get; set; }
public string[] OrderedViews { get; set; }
public string[] LatestItemsExcludes { get; set; }
public bool HidePlayedInLatest { get; set; }
public bool RememberAudioSelections { get; set; }
public bool RememberSubtitleSelections { get; set; }
public bool EnableNextEpisodeAutoPlay { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="UserConfiguration" /> class.
/// </summary>
public UserConfiguration()
{
EnableNextEpisodeAutoPlay = true;
RememberAudioSelections = true;
RememberSubtitleSelections = true;
HidePlayedInLatest = true;
PlayDefaultAudioTrack = true;
LatestItemsExcludes = new string[] { };
OrderedViews = new string[] { };
GroupedFolders = new string[] { };
}
}
}

View File

@@ -1,23 +0,0 @@

namespace MediaBrowser.Model.Configuration
{
public class XbmcMetadataOptions
{
public string UserId { get; set; }
public string ReleaseDateFormat { get; set; }
public bool SaveImagePathsInNfo { get; set; }
public bool EnablePathSubstitution { get; set; }
public bool EnableExtraThumbsDuplication { get; set; }
public XbmcMetadataOptions()
{
ReleaseDateFormat = "yyyy-MM-dd";
SaveImagePathsInNfo = true;
EnablePathSubstitution = true;
}
}
}

View File

@@ -1,17 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public class ConnectAuthenticationExchangeResult
{
/// <summary>
/// Gets or sets the local user identifier.
/// </summary>
/// <value>The local user identifier.</value>
public string LocalUserId { get; set; }
/// <summary>
/// Gets or sets the access token.
/// </summary>
/// <value>The access token.</value>
public string AccessToken { get; set; }
}
}

View File

@@ -1,17 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public class ConnectAuthenticationResult
{
/// <summary>
/// Gets or sets the user.
/// </summary>
/// <value>The user.</value>
public ConnectUser User { get; set; }
/// <summary>
/// Gets or sets the access token.
/// </summary>
/// <value>The access token.</value>
public string AccessToken { get; set; }
}
}

View File

@@ -1,20 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public class ConnectAuthorization
{
public string ConnectUserId { get; set; }
public string UserName { get; set; }
public string ImageUrl { get; set; }
public string Id { get; set; }
public string[] EnabledLibraries { get; set; }
public bool EnableLiveTv { get; set; }
public string[] EnabledChannels { get; set; }
public ConnectAuthorization()
{
EnabledLibraries = new string[] { };
EnabledChannels = new string[] { };
}
}
}

View File

@@ -1,18 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public class ConnectAuthorizationRequest
{
public string SendingUserId { get; set; }
public string ConnectUserName { get; set; }
public string[] EnabledLibraries { get; set; }
public bool EnableLiveTv { get; set; }
public string[] EnabledChannels { get; set; }
public ConnectAuthorizationRequest()
{
EnabledLibraries = new string[] { };
EnabledChannels = new string[] { };
}
}
}

View File

@@ -1,19 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public static class ConnectPassword
{
public static string PerformPreHashFilter(string password)
{
return password
.Replace("&", "&amp;")
.Replace("/", "&#092;")
.Replace("!", "&#33;")
.Replace("$", "&#036;")
.Replace("\"", "&quot;")
.Replace("<", "&lt;")
.Replace(">", "&gt;")
.Replace("'", "&#39;");
}
}
}

View File

@@ -1,12 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public class ConnectUser
{
public string Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public bool IsActive { get; set; }
public string ImageUrl { get; set; }
}
}

View File

@@ -1,11 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public class ConnectUserQuery
{
public string Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public string NameOrEmail { get; set; }
}
}

View File

@@ -1,14 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public class ConnectUserServer
{
public string Id { get; set; }
public string Url { get; set; }
public string Name { get; set; }
public string AccessKey { get; set; }
public string SystemId { get; set; }
public string LocalAddress { get; set; }
public string UserType { get; set; }
}
}

View File

@@ -1,11 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public class PinCreationResult
{
public string Pin { get; set; }
public string DeviceId { get; set; }
public bool IsConfirmed { get; set; }
public bool IsExpired { get; set; }
}
}

View File

@@ -1,9 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public class PinExchangeResult
{
public string UserId { get; set; }
public string AccessToken { get; set; }
}
}

View File

@@ -1,10 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public class PinStatusResult
{
public string Pin { get; set; }
public bool IsConfirmed { get; set; }
public bool IsExpired { get; set; }
}
}

View File

@@ -1,15 +0,0 @@

namespace MediaBrowser.Model.Connect
{
public enum UserLinkType
{
/// <summary>
/// The linked user
/// </summary>
LinkedUser = 0,
/// <summary>
/// The guest
/// </summary>
Guest = 1
}
}

View File

@@ -1,13 +0,0 @@
using System;
using System.IO;
namespace MediaBrowser.Model.Cryptography
{
public interface ICryptoProvider
{
Guid GetMD5(string str);
byte[] ComputeMD5(Stream str);
byte[] ComputeMD5(byte[] bytes);
byte[] ComputeSHA1(byte[] bytes);
}
}

View File

@@ -1,15 +0,0 @@
using System.Collections.Generic;
namespace MediaBrowser.Model.Devices
{
public class ContentUploadHistory
{
public string DeviceId { get; set; }
public LocalFileInfo[] FilesUploaded { get; set; }
public ContentUploadHistory()
{
FilesUploaded = new LocalFileInfo[] { };
}
}
}

View File

@@ -1,67 +0,0 @@
using MediaBrowser.Model.Session;
using System;
namespace MediaBrowser.Model.Devices
{
public class DeviceInfo
{
/// <summary>
/// Gets or sets the name of the reported.
/// </summary>
/// <value>The name of the reported.</value>
public string ReportedName { get; set; }
/// <summary>
/// Gets or sets the name of the custom.
/// </summary>
/// <value>The name of the custom.</value>
public string CustomName { get; set; }
/// <summary>
/// Gets or sets the camera upload path.
/// </summary>
/// <value>The camera upload path.</value>
public string CameraUploadPath { get; set; }
public string Name { get; set; }
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public string Id { get; set; }
/// <summary>
/// Gets or sets the last name of the user.
/// </summary>
/// <value>The last name of the user.</value>
public string LastUserName { get; set; }
/// <summary>
/// Gets or sets the name of the application.
/// </summary>
/// <value>The name of the application.</value>
public string AppName { get; set; }
/// <summary>
/// Gets or sets the application version.
/// </summary>
/// <value>The application version.</value>
public string AppVersion { get; set; }
/// <summary>
/// Gets or sets the last user identifier.
/// </summary>
/// <value>The last user identifier.</value>
public string LastUserId { get; set; }
/// <summary>
/// Gets or sets the date last modified.
/// </summary>
/// <value>The date last modified.</value>
public DateTime DateLastModified { get; set; }
/// <summary>
/// Gets or sets the capabilities.
/// </summary>
/// <value>The capabilities.</value>
public ClientCapabilities Capabilities { get; set; }
public DeviceInfo()
{
Capabilities = new ClientCapabilities();
}
}
}

View File

@@ -1,17 +0,0 @@

namespace MediaBrowser.Model.Devices
{
public class DeviceOptions
{
/// <summary>
/// Gets or sets the name of the custom.
/// </summary>
/// <value>The name of the custom.</value>
public string CustomName { get; set; }
/// <summary>
/// Gets or sets the camera upload path.
/// </summary>
/// <value>The camera upload path.</value>
public string CameraUploadPath { get; set; }
}
}

View File

@@ -1,22 +0,0 @@

namespace MediaBrowser.Model.Devices
{
public class DeviceQuery
{
/// <summary>
/// Gets or sets a value indicating whether [supports unique identifier].
/// </summary>
/// <value><c>null</c> if [supports unique identifier] contains no value, <c>true</c> if [supports unique identifier]; otherwise, <c>false</c>.</value>
public bool? SupportsPersistentIdentifier { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [supports synchronize].
/// </summary>
/// <value><c>null</c> if [supports synchronize] contains no value, <c>true</c> if [supports synchronize]; otherwise, <c>false</c>.</value>
public bool? SupportsSync { get; set; }
/// <summary>
/// Gets or sets the user identifier.
/// </summary>
/// <value>The user identifier.</value>
public string UserId { get; set; }
}
}

View File

@@ -1,15 +0,0 @@

namespace MediaBrowser.Model.Devices
{
public class DevicesOptions
{
public string[] EnabledCameraUploadDevices { get; set; }
public string CameraUploadPath { get; set; }
public bool EnableCameraUploadSubfolders { get; set; }
public DevicesOptions()
{
EnabledCameraUploadDevices = new string[] { };
}
}
}

View File

@@ -1,11 +0,0 @@

namespace MediaBrowser.Model.Devices
{
public class LocalFileInfo
{
public string Name { get; set; }
public string Id { get; set; }
public string Album { get; set; }
public string MimeType { get; set; }
}
}

View File

@@ -1,21 +0,0 @@
using System;
using System.IO;
using System.Threading.Tasks;
namespace MediaBrowser.Model.Diagnostics
{
public interface IProcess : IDisposable
{
event EventHandler Exited;
void Kill();
bool WaitForExit(int timeMs);
Task<bool> WaitForExitAsync(int timeMs);
int ExitCode { get; }
void Start();
StreamWriter StandardInput { get; }
StreamReader StandardError { get; }
StreamReader StandardOutput { get; }
ProcessOptions StartInfo { get; }
}
}

View File

@@ -1,24 +0,0 @@
using System;
namespace MediaBrowser.Model.Diagnostics
{
public interface IProcessFactory
{
IProcess Create(ProcessOptions options);
}
public class ProcessOptions
{
public String FileName { get; set; }
public String Arguments { get; set; }
public String WorkingDirectory { get; set; }
public bool CreateNoWindow { get; set; }
public bool UseShellExecute { get; set; }
public bool EnableRaisingEvents { get; set; }
public bool ErrorDialog { get; set; }
public bool RedirectStandardError { get; set; }
public bool RedirectStandardInput { get; set; }
public bool RedirectStandardOutput { get; set; }
public bool IsHidden { get; set; }
}
}

View File

@@ -1,86 +0,0 @@
using MediaBrowser.Model.Dto;
using System.Collections.Generic;
namespace MediaBrowser.Model.Dlna
{
/// <summary>
/// Class AudioOptions.
/// </summary>
public class AudioOptions
{
public AudioOptions()
{
Context = EncodingContext.Streaming;
EnableDirectPlay = true;
EnableDirectStream = true;
}
public bool EnableDirectPlay { get; set; }
public bool EnableDirectStream { get; set; }
public bool ForceDirectPlay { get; set; }
public bool ForceDirectStream { get; set; }
public string ItemId { get; set; }
public MediaSourceInfo[] MediaSources { get; set; }
public DeviceProfile Profile { get; set; }
/// <summary>
/// Optional. Only needed if a specific AudioStreamIndex or SubtitleStreamIndex are requested.
/// </summary>
public string MediaSourceId { get; set; }
public string DeviceId { get; set; }
/// <summary>
/// Allows an override of supported number of audio channels
/// Example: DeviceProfile supports five channel, but user only has stereo speakers
/// </summary>
public int? MaxAudioChannels { get; set; }
/// <summary>
/// The application's configured quality setting
/// </summary>
public long? MaxBitrate { get; set; }
/// <summary>
/// Gets or sets the context.
/// </summary>
/// <value>The context.</value>
public EncodingContext Context { get; set; }
/// <summary>
/// Gets or sets the audio transcoding bitrate.
/// </summary>
/// <value>The audio transcoding bitrate.</value>
public int? AudioTranscodingBitrate { get; set; }
/// <summary>
/// Gets the maximum bitrate.
/// </summary>
/// <returns>System.Nullable&lt;System.Int32&gt;.</returns>
public long? GetMaxBitrate(bool isAudio)
{
if (MaxBitrate.HasValue)
{
return MaxBitrate;
}
if (Profile != null)
{
if (Context == EncodingContext.Static)
{
if (isAudio && Profile.MaxStaticMusicBitrate.HasValue)
{
return Profile.MaxStaticMusicBitrate;
}
return Profile.MaxStaticBitrate;
}
return Profile.MaxStreamingBitrate;
}
return null;
}
}
}

View File

@@ -1,68 +0,0 @@
using MediaBrowser.Model.Extensions;
using System.Collections.Generic;
using System.Xml.Serialization;
using MediaBrowser.Model.Dlna;
namespace MediaBrowser.Model.Dlna
{
public class CodecProfile
{
[XmlAttribute("type")]
public CodecType Type { get; set; }
public ProfileCondition[] Conditions { get; set; }
public ProfileCondition[] ApplyConditions { get; set; }
[XmlAttribute("codec")]
public string Codec { get; set; }
[XmlAttribute("container")]
public string Container { get; set; }
public CodecProfile()
{
Conditions = new ProfileCondition[] {};
ApplyConditions = new ProfileCondition[] { };
}
public string[] GetCodecs()
{
return ContainerProfile.SplitValue(Codec);
}
private bool ContainsContainer(string container)
{
return ContainerProfile.ContainsContainer(Container, container);
}
public bool ContainsAnyCodec(string codec, string container)
{
return ContainsAnyCodec(ContainerProfile.SplitValue(codec), container);
}
public bool ContainsAnyCodec(string[] codec, string container)
{
if (!ContainsContainer(container))
{
return false;
}
var codecs = GetCodecs();
if (codecs.Length == 0)
{
return true;
}
foreach (var val in codec)
{
if (ListHelper.ContainsIgnoreCase(codecs, val))
{
return true;
}
}
return false;
}
}
}

View File

@@ -1,9 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public enum CodecType
{
Video = 0,
VideoAudio = 1,
Audio = 2
}
}

View File

@@ -1,284 +0,0 @@
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
using System;
using System.Collections.Generic;
using System.Globalization;
namespace MediaBrowser.Model.Dlna
{
public class ConditionProcessor
{
public bool IsVideoConditionSatisfied(ProfileCondition condition,
int? width,
int? height,
int? videoBitDepth,
int? videoBitrate,
string videoProfile,
double? videoLevel,
float? videoFramerate,
int? packetLength,
TransportStreamTimestamp? timestamp,
bool? isAnamorphic,
bool? isInterlaced,
int? refFrames,
int? numVideoStreams,
int? numAudioStreams,
string videoCodecTag,
bool? isAvc )
{
switch (condition.Property)
{
case ProfileConditionValue.IsInterlaced:
return IsConditionSatisfied(condition, isInterlaced);
case ProfileConditionValue.IsAnamorphic:
return IsConditionSatisfied(condition, isAnamorphic);
case ProfileConditionValue.IsAvc:
return IsConditionSatisfied(condition, isAvc);
case ProfileConditionValue.VideoFramerate:
return IsConditionSatisfied(condition, videoFramerate);
case ProfileConditionValue.VideoLevel:
return IsConditionSatisfied(condition, videoLevel);
case ProfileConditionValue.VideoProfile:
return IsConditionSatisfied(condition, videoProfile);
case ProfileConditionValue.VideoCodecTag:
return IsConditionSatisfied(condition, videoCodecTag);
case ProfileConditionValue.PacketLength:
return IsConditionSatisfied(condition, packetLength);
case ProfileConditionValue.VideoBitDepth:
return IsConditionSatisfied(condition, videoBitDepth);
case ProfileConditionValue.VideoBitrate:
return IsConditionSatisfied(condition, videoBitrate);
case ProfileConditionValue.Height:
return IsConditionSatisfied(condition, height);
case ProfileConditionValue.Width:
return IsConditionSatisfied(condition, width);
case ProfileConditionValue.RefFrames:
return IsConditionSatisfied(condition, refFrames);
case ProfileConditionValue.NumAudioStreams:
return IsConditionSatisfied(condition, numAudioStreams);
case ProfileConditionValue.NumVideoStreams:
return IsConditionSatisfied(condition, numVideoStreams);
case ProfileConditionValue.VideoTimestamp:
return IsConditionSatisfied(condition, timestamp);
default:
return true;
}
}
public bool IsImageConditionSatisfied(ProfileCondition condition, int? width, int? height)
{
switch (condition.Property)
{
case ProfileConditionValue.Height:
return IsConditionSatisfied(condition, height);
case ProfileConditionValue.Width:
return IsConditionSatisfied(condition, width);
default:
throw new ArgumentException("Unexpected condition on image file: " + condition.Property);
}
}
public bool IsAudioConditionSatisfied(ProfileCondition condition, int? audioChannels, int? audioBitrate, int? audioSampleRate, int? audioBitDepth)
{
switch (condition.Property)
{
case ProfileConditionValue.AudioBitrate:
return IsConditionSatisfied(condition, audioBitrate);
case ProfileConditionValue.AudioChannels:
return IsConditionSatisfied(condition, audioChannels);
case ProfileConditionValue.AudioSampleRate:
return IsConditionSatisfied(condition, audioSampleRate);
case ProfileConditionValue.AudioBitDepth:
return IsConditionSatisfied(condition, audioBitDepth);
default:
throw new ArgumentException("Unexpected condition on audio file: " + condition.Property);
}
}
public bool IsVideoAudioConditionSatisfied(ProfileCondition condition,
int? audioChannels,
int? audioBitrate,
int? audioSampleRate,
int? audioBitDepth,
string audioProfile,
bool? isSecondaryTrack)
{
switch (condition.Property)
{
case ProfileConditionValue.AudioProfile:
return IsConditionSatisfied(condition, audioProfile);
case ProfileConditionValue.AudioBitrate:
return IsConditionSatisfied(condition, audioBitrate);
case ProfileConditionValue.AudioChannels:
return IsConditionSatisfied(condition, audioChannels);
case ProfileConditionValue.IsSecondaryAudio:
return IsConditionSatisfied(condition, isSecondaryTrack);
case ProfileConditionValue.AudioSampleRate:
return IsConditionSatisfied(condition, audioSampleRate);
case ProfileConditionValue.AudioBitDepth:
return IsConditionSatisfied(condition, audioBitDepth);
default:
throw new ArgumentException("Unexpected condition on audio file: " + condition.Property);
}
}
private bool IsConditionSatisfied(ProfileCondition condition, int? currentValue)
{
if (!currentValue.HasValue)
{
// If the value is unknown, it satisfies if not marked as required
return !condition.IsRequired;
}
int expected;
if (int.TryParse(condition.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out expected))
{
switch (condition.Condition)
{
case ProfileConditionType.Equals:
case ProfileConditionType.EqualsAny:
return currentValue.Value.Equals(expected);
case ProfileConditionType.GreaterThanEqual:
return currentValue.Value >= expected;
case ProfileConditionType.LessThanEqual:
return currentValue.Value <= expected;
case ProfileConditionType.NotEquals:
return !currentValue.Value.Equals(expected);
default:
throw new InvalidOperationException("Unexpected ProfileConditionType: " + condition.Condition);
}
}
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, string currentValue)
{
if (string.IsNullOrEmpty(currentValue))
{
// If the value is unknown, it satisfies if not marked as required
return !condition.IsRequired;
}
string expected = condition.Value;
switch (condition.Condition)
{
case ProfileConditionType.EqualsAny:
{
return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue);
}
case ProfileConditionType.Equals:
return StringHelper.EqualsIgnoreCase(currentValue, expected);
case ProfileConditionType.NotEquals:
return !StringHelper.EqualsIgnoreCase(currentValue, expected);
default:
throw new InvalidOperationException("Unexpected ProfileConditionType: " + condition.Condition);
}
}
private bool IsConditionSatisfied(ProfileCondition condition, bool? currentValue)
{
if (!currentValue.HasValue)
{
// If the value is unknown, it satisfies if not marked as required
return !condition.IsRequired;
}
bool expected;
if (bool.TryParse(condition.Value, out expected))
{
switch (condition.Condition)
{
case ProfileConditionType.Equals:
return currentValue.Value == expected;
case ProfileConditionType.NotEquals:
return currentValue.Value != expected;
default:
throw new InvalidOperationException("Unexpected ProfileConditionType: " + condition.Condition);
}
}
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, float? currentValue)
{
if (!currentValue.HasValue)
{
// If the value is unknown, it satisfies if not marked as required
return !condition.IsRequired;
}
float expected;
if (float.TryParse(condition.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out expected))
{
switch (condition.Condition)
{
case ProfileConditionType.Equals:
return currentValue.Value.Equals(expected);
case ProfileConditionType.GreaterThanEqual:
return currentValue.Value >= expected;
case ProfileConditionType.LessThanEqual:
return currentValue.Value <= expected;
case ProfileConditionType.NotEquals:
return !currentValue.Value.Equals(expected);
default:
throw new InvalidOperationException("Unexpected ProfileConditionType: " + condition.Condition);
}
}
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, double? currentValue)
{
if (!currentValue.HasValue)
{
// If the value is unknown, it satisfies if not marked as required
return !condition.IsRequired;
}
double expected;
if (double.TryParse(condition.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out expected))
{
switch (condition.Condition)
{
case ProfileConditionType.Equals:
return currentValue.Value.Equals(expected);
case ProfileConditionType.GreaterThanEqual:
return currentValue.Value >= expected;
case ProfileConditionType.LessThanEqual:
return currentValue.Value <= expected;
case ProfileConditionType.NotEquals:
return !currentValue.Value.Equals(expected);
default:
throw new InvalidOperationException("Unexpected ProfileConditionType: " + condition.Condition);
}
}
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, TransportStreamTimestamp? timestamp)
{
if (!timestamp.HasValue)
{
// If the value is unknown, it satisfies if not marked as required
return !condition.IsRequired;
}
TransportStreamTimestamp expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true);
switch (condition.Condition)
{
case ProfileConditionType.Equals:
return timestamp == expected;
case ProfileConditionType.NotEquals:
return timestamp != expected;
default:
throw new InvalidOperationException("Unexpected ProfileConditionType: " + condition.Condition);
}
}
}
}

View File

@@ -1,72 +0,0 @@
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dlna
{
public class ContainerProfile
{
[XmlAttribute("type")]
public DlnaProfileType Type { get; set; }
public ProfileCondition[] Conditions { get; set; }
[XmlAttribute("container")]
public string Container { get; set; }
public ContainerProfile()
{
Conditions = new ProfileCondition[] { };
}
public string[] GetContainers()
{
return SplitValue(Container);
}
private static readonly string[] EmptyStringArray = new string[] { };
public static string[] SplitValue(string value)
{
if (string.IsNullOrWhiteSpace(value))
{
return EmptyStringArray;
}
return value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
}
public bool ContainsContainer(string container)
{
var containers = GetContainers();
return ContainsContainer(containers, container);
}
public static bool ContainsContainer(string profileContainers, string inputContainer)
{
return ContainsContainer(SplitValue(profileContainers), inputContainer);
}
public static bool ContainsContainer(string[] profileContainers, string inputContainer)
{
if (profileContainers.Length == 0)
{
return true;
}
var allInputContainers = SplitValue(inputContainer);
foreach (var container in allInputContainers)
{
if (ListHelper.ContainsIgnoreCase(profileContainers, container))
{
return true;
}
}
return false;
}
}
}

View File

@@ -1,238 +0,0 @@
using MediaBrowser.Model.MediaInfo;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.Dlna
{
public class ContentFeatureBuilder
{
private readonly DeviceProfile _profile;
public ContentFeatureBuilder(DeviceProfile profile)
{
_profile = profile;
}
public string BuildImageHeader(string container,
int? width,
int? height,
bool isDirectStream,
string orgPn = null)
{
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetImageOrgOpValue();
// 0 = native, 1 = transcoded
var orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
DlnaFlags flagValue = DlnaFlags.BackgroundTransferMode |
DlnaFlags.InteractiveTransferMode |
DlnaFlags.DlnaV15;
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
DlnaMaps.FlagsToString(flagValue));
ResponseProfile mediaProfile = _profile.GetImageMediaProfile(container,
width,
height);
if (string.IsNullOrEmpty(orgPn))
{
orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;
}
if (string.IsNullOrEmpty(orgPn))
{
orgPn = GetImageOrgPnValue(container, width, height);
}
string contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn;
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
}
public string BuildAudioHeader(string container,
string audioCodec,
int? audioBitrate,
int? audioSampleRate,
int? audioChannels,
int? audioBitDepth,
bool isDirectStream,
long? runtimeTicks,
TranscodeSeekInfo transcodeSeekInfo)
{
// first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo);
// 0 = native, 1 = transcoded
string orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
DlnaFlags flagValue = DlnaFlags.StreamingTransferMode |
DlnaFlags.BackgroundTransferMode |
DlnaFlags.InteractiveTransferMode |
DlnaFlags.DlnaV15;
//if (isDirectStream)
//{
// flagValue = flagValue | DlnaFlags.ByteBasedSeek;
//}
//else if (runtimeTicks.HasValue)
//{
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
//}
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
DlnaMaps.FlagsToString(flagValue));
ResponseProfile mediaProfile = _profile.GetAudioMediaProfile(container,
audioCodec,
audioChannels,
audioBitrate,
audioSampleRate,
audioBitDepth);
string orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;
if (string.IsNullOrEmpty(orgPn))
{
orgPn = GetAudioOrgPnValue(container, audioBitrate, audioSampleRate, audioChannels);
}
string contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn;
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
}
public List<string> BuildVideoHeader(string container,
string videoCodec,
string audioCodec,
int? width,
int? height,
int? bitDepth,
int? videoBitrate,
TransportStreamTimestamp timestamp,
bool isDirectStream,
long? runtimeTicks,
string videoProfile,
double? videoLevel,
float? videoFramerate,
int? packetLength,
TranscodeSeekInfo transcodeSeekInfo,
bool? isAnamorphic,
bool? isInterlaced,
int? refFrames,
int? numVideoStreams,
int? numAudioStreams,
string videoCodecTag,
bool? isAvc)
{
// first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo);
// 0 = native, 1 = transcoded
string orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
DlnaFlags flagValue = DlnaFlags.StreamingTransferMode |
DlnaFlags.BackgroundTransferMode |
DlnaFlags.InteractiveTransferMode |
DlnaFlags.DlnaV15;
//if (isDirectStream)
//{
// flagValue = flagValue | DlnaFlags.ByteBasedSeek;
//}
//else if (runtimeTicks.HasValue)
//{
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
//}
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
DlnaMaps.FlagsToString(flagValue));
ResponseProfile mediaProfile = _profile.GetVideoMediaProfile(container,
audioCodec,
videoCodec,
width,
height,
bitDepth,
videoBitrate,
videoProfile,
videoLevel,
videoFramerate,
packetLength,
timestamp,
isAnamorphic,
isInterlaced,
refFrames,
numVideoStreams,
numAudioStreams,
videoCodecTag,
isAvc);
List<string> orgPnValues = new List<string>();
if (mediaProfile != null && !string.IsNullOrEmpty(mediaProfile.OrgPn))
{
orgPnValues.AddRange(mediaProfile.OrgPn.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
}
else
{
foreach (string s in GetVideoOrgPnValue(container, videoCodec, audioCodec, width, height, timestamp))
{
orgPnValues.Add(s);
break;
}
}
List<string> contentFeatureList = new List<string>();
foreach (string orgPn in orgPnValues)
{
string contentFeatures = string.IsNullOrEmpty(orgPn) ? string.Empty : "DLNA.ORG_PN=" + orgPn;
var value = (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
contentFeatureList.Add(value);
}
if (orgPnValues.Count == 0)
{
string contentFeatures = string.Empty;
var value = (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
contentFeatureList.Add(value);
}
return contentFeatureList;
}
private string GetImageOrgPnValue(string container, int? width, int? height)
{
MediaFormatProfile? format = new MediaFormatProfileResolver()
.ResolveImageFormat(container,
width,
height);
return format.HasValue ? format.Value.ToString() : null;
}
private string GetAudioOrgPnValue(string container, int? audioBitrate, int? audioSampleRate, int? audioChannels)
{
MediaFormatProfile? format = new MediaFormatProfileResolver()
.ResolveAudioFormat(container,
audioBitrate,
audioSampleRate,
audioChannels);
return format.HasValue ? format.Value.ToString() : null;
}
private List<string> GetVideoOrgPnValue(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestamp)
{
List<string> list = new List<string>();
foreach (MediaFormatProfile i in new MediaFormatProfileResolver().ResolveVideoFormat(container, videoCodec, audioCodec, width, height, timestamp))
list.Add(i.ToString());
return list;
}
}
}

View File

@@ -1,61 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public class DeviceIdentification
{
/// <summary>
/// Gets or sets the name of the friendly.
/// </summary>
/// <value>The name of the friendly.</value>
public string FriendlyName { get; set; }
/// <summary>
/// Gets or sets the model number.
/// </summary>
/// <value>The model number.</value>
public string ModelNumber { get; set; }
/// <summary>
/// Gets or sets the serial number.
/// </summary>
/// <value>The serial number.</value>
public string SerialNumber { get; set; }
/// <summary>
/// Gets or sets the name of the model.
/// </summary>
/// <value>The name of the model.</value>
public string ModelName { get; set; }
/// <summary>
/// Gets or sets the model description.
/// </summary>
/// <value>The model description.</value>
public string ModelDescription { get; set; }
/// <summary>
/// Gets or sets the device description.
/// </summary>
/// <value>The device description.</value>
public string DeviceDescription { get; set; }
/// <summary>
/// Gets or sets the model URL.
/// </summary>
/// <value>The model URL.</value>
public string ModelUrl { get; set; }
/// <summary>
/// Gets or sets the manufacturer.
/// </summary>
/// <value>The manufacturer.</value>
public string Manufacturer { get; set; }
/// <summary>
/// Gets or sets the manufacturer URL.
/// </summary>
/// <value>The manufacturer URL.</value>
public string ManufacturerUrl { get; set; }
/// <summary>
/// Gets or sets the headers.
/// </summary>
/// <value>The headers.</value>
public HttpHeaderInfo[] Headers { get; set; }
public DeviceIdentification()
{
Headers = new HttpHeaderInfo[] {};
}
}
}

View File

@@ -1,334 +0,0 @@
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace MediaBrowser.Model.Dlna
{
[XmlRoot("Profile")]
public class DeviceProfile
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
[XmlIgnore]
public string Id { get; set; }
/// <summary>
/// Gets or sets the identification.
/// </summary>
/// <value>The identification.</value>
public MediaBrowser.Model.Dlna.DeviceIdentification Identification { get; set; }
public string FriendlyName { get; set; }
public string Manufacturer { get; set; }
public string ManufacturerUrl { get; set; }
public string ModelName { get; set; }
public string ModelDescription { get; set; }
public string ModelNumber { get; set; }
public string ModelUrl { get; set; }
public string SerialNumber { get; set; }
public bool EnableAlbumArtInDidl { get; set; }
public bool EnableSingleAlbumArtLimit { get; set; }
public bool EnableSingleSubtitleLimit { get; set; }
public string SupportedMediaTypes { get; set; }
public string UserId { get; set; }
public string AlbumArtPn { get; set; }
public int MaxAlbumArtWidth { get; set; }
public int MaxAlbumArtHeight { get; set; }
public int? MaxIconWidth { get; set; }
public int? MaxIconHeight { get; set; }
public long? MaxStreamingBitrate { get; set; }
public long? MaxStaticBitrate { get; set; }
public int? MusicStreamingTranscodingBitrate { get; set; }
public int? MaxStaticMusicBitrate { get; set; }
/// <summary>
/// Controls the content of the X_DLNADOC element in the urn:schemas-dlna-org:device-1-0 namespace.
/// </summary>
public string XDlnaDoc { get; set; }
/// <summary>
/// Controls the content of the X_DLNACAP element in the urn:schemas-dlna-org:device-1-0 namespace.
/// </summary>
public string XDlnaCap { get; set; }
/// <summary>
/// Controls the content of the aggregationFlags element in the urn:schemas-sonycom:av namespace.
/// </summary>
public string SonyAggregationFlags { get; set; }
public string ProtocolInfo { get; set; }
public int TimelineOffsetSeconds { get; set; }
public bool RequiresPlainVideoItems { get; set; }
public bool RequiresPlainFolders { get; set; }
public bool EnableMSMediaReceiverRegistrar { get; set; }
public bool IgnoreTranscodeByteRangeRequests { get; set; }
public XmlAttribute[] XmlRootAttributes { get; set; }
/// <summary>
/// Gets or sets the direct play profiles.
/// </summary>
/// <value>The direct play profiles.</value>
public DirectPlayProfile[] DirectPlayProfiles { get; set; }
/// <summary>
/// Gets or sets the transcoding profiles.
/// </summary>
/// <value>The transcoding profiles.</value>
public TranscodingProfile[] TranscodingProfiles { get; set; }
public ContainerProfile[] ContainerProfiles { get; set; }
public CodecProfile[] CodecProfiles { get; set; }
public ResponseProfile[] ResponseProfiles { get; set; }
public SubtitleProfile[] SubtitleProfiles { get; set; }
public DeviceProfile()
{
DirectPlayProfiles = new DirectPlayProfile[] { };
TranscodingProfiles = new TranscodingProfile[] { };
ResponseProfiles = new ResponseProfile[] { };
CodecProfiles = new CodecProfile[] { };
ContainerProfiles = new ContainerProfile[] { };
SubtitleProfiles = new SubtitleProfile[] { };
XmlRootAttributes = new XmlAttribute[] { };
SupportedMediaTypes = "Audio,Photo,Video";
MaxStreamingBitrate = 8000000;
MaxStaticBitrate = 8000000;
MusicStreamingTranscodingBitrate = 128000;
}
public string[] GetSupportedMediaTypes()
{
return ContainerProfile.SplitValue(SupportedMediaTypes);
}
public TranscodingProfile GetAudioTranscodingProfile(string container, string audioCodec)
{
container = StringHelper.TrimStart(container ?? string.Empty, '.');
foreach (var i in TranscodingProfiles)
{
if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Audio)
{
continue;
}
if (!StringHelper.EqualsIgnoreCase(container, i.Container))
{
continue;
}
if (!ListHelper.ContainsIgnoreCase(i.GetAudioCodecs(), audioCodec ?? string.Empty))
{
continue;
}
return i;
}
return null;
}
public TranscodingProfile GetVideoTranscodingProfile(string container, string audioCodec, string videoCodec)
{
container = StringHelper.TrimStart(container ?? string.Empty, '.');
foreach (var i in TranscodingProfiles)
{
if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Video)
{
continue;
}
if (!StringHelper.EqualsIgnoreCase(container, i.Container))
{
continue;
}
if (!ListHelper.ContainsIgnoreCase(i.GetAudioCodecs(), audioCodec ?? string.Empty))
{
continue;
}
if (!StringHelper.EqualsIgnoreCase(videoCodec, i.VideoCodec ?? string.Empty))
{
continue;
}
return i;
}
return null;
}
public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, int? audioChannels, int? audioBitrate, int? audioSampleRate, int? audioBitDepth)
{
foreach (var i in ResponseProfiles)
{
if (i.Type != DlnaProfileType.Audio)
{
continue;
}
if (!ContainerProfile.ContainsContainer(i.GetContainers(), container))
{
continue;
}
var audioCodecs = i.GetAudioCodecs();
if (audioCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
{
continue;
}
var conditionProcessor = new ConditionProcessor();
var anyOff = false;
foreach (ProfileCondition c in i.Conditions)
{
if (!conditionProcessor.IsAudioConditionSatisfied(GetModelProfileCondition(c), audioChannels, audioBitrate, audioSampleRate, audioBitDepth))
{
anyOff = true;
break;
}
}
if (anyOff)
{
continue;
}
return i;
}
return null;
}
private ProfileCondition GetModelProfileCondition(ProfileCondition c)
{
return new ProfileCondition
{
Condition = c.Condition,
IsRequired = c.IsRequired,
Property = c.Property,
Value = c.Value
};
}
public ResponseProfile GetImageMediaProfile(string container, int? width, int? height)
{
foreach (var i in ResponseProfiles)
{
if (i.Type != DlnaProfileType.Photo)
{
continue;
}
if (!ContainerProfile.ContainsContainer(i.GetContainers(), container))
{
continue;
}
var conditionProcessor = new ConditionProcessor();
var anyOff = false;
foreach (ProfileCondition c in i.Conditions)
{
if (!conditionProcessor.IsImageConditionSatisfied(GetModelProfileCondition(c), width, height))
{
anyOff = true;
break;
}
}
if (anyOff)
{
continue;
}
return i;
}
return null;
}
public ResponseProfile GetVideoMediaProfile(string container,
string audioCodec,
string videoCodec,
int? width,
int? height,
int? bitDepth,
int? videoBitrate,
string videoProfile,
double? videoLevel,
float? videoFramerate,
int? packetLength,
TransportStreamTimestamp timestamp,
bool? isAnamorphic,
bool? isInterlaced,
int? refFrames,
int? numVideoStreams,
int? numAudioStreams,
string videoCodecTag,
bool? isAvc)
{
foreach (var i in ResponseProfiles)
{
if (i.Type != DlnaProfileType.Video)
{
continue;
}
if (!ContainerProfile.ContainsContainer(i.GetContainers(), container))
{
continue;
}
var audioCodecs = i.GetAudioCodecs();
if (audioCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
{
continue;
}
var videoCodecs = i.GetVideoCodecs();
if (videoCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(videoCodecs, videoCodec ?? string.Empty))
{
continue;
}
var conditionProcessor = new ConditionProcessor();
var anyOff = false;
foreach (ProfileCondition c in i.Conditions)
{
if (!conditionProcessor.IsVideoConditionSatisfied(GetModelProfileCondition(c), width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{
anyOff = true;
break;
}
}
if (anyOff)
{
continue;
}
return i;
}
return null;
}
}
}

View File

@@ -1,24 +0,0 @@

namespace MediaBrowser.Model.Dlna
{
public class DeviceProfileInfo
{
/// <summary>
/// Gets or sets the identifier.
/// </summary>
/// <value>The identifier.</value>
public string Id { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
public DeviceProfileType Type { get; set; }
}
}

View File

@@ -1,8 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public enum DeviceProfileType
{
System = 0,
User = 1
}
}

View File

@@ -1,36 +0,0 @@
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace MediaBrowser.Model.Dlna
{
public class DirectPlayProfile
{
[XmlAttribute("container")]
public string Container { get; set; }
[XmlAttribute("audioCodec")]
public string AudioCodec { get; set; }
[XmlAttribute("videoCodec")]
public string VideoCodec { get; set; }
[XmlAttribute("type")]
public DlnaProfileType Type { get; set; }
public bool SupportsContainer(string container)
{
return ContainerProfile.ContainsContainer(Container, container);
}
public string[] GetAudioCodecs()
{
return ContainerProfile.SplitValue(AudioCodec);
}
public string[] GetVideoCodecs()
{
return ContainerProfile.SplitValue(VideoCodec);
}
}
}

View File

@@ -1,48 +0,0 @@
using System;
namespace MediaBrowser.Model.Dlna
{
[Flags]
public enum DlnaFlags : ulong
{
/*! <i>Background</i> transfer mode.
For use with upload and download transfers to and from the server.
The primary difference between \ref DH_TransferMode_Interactive and
\ref DH_TransferMode_Bulk is that the latter assumes that the user
is not relying on the transfer for immediately rendering the content
and there are no issues with causing a buffer overflow if the
receiver uses TCP flow control to reduce total throughput.
*/
BackgroundTransferMode = 1 << 22,
ByteBasedSeek = 1 << 29,
ConnectionStall = 1 << 21,
DlnaV15 = 1 << 20,
/*! <i>Interactive</i> transfer mode.
For best effort transfer of images and non-real-time transfers.
URIs with image content usually support \ref DH_TransferMode_Bulk too.
The primary difference between \ref DH_TransferMode_Interactive and
\ref DH_TransferMode_Bulk is that the former assumes that the
transfer is intended for immediate rendering.
*/
InteractiveTransferMode = 1 << 23,
PlayContainer = 1 << 28,
RtspPause = 1 << 25,
S0Increase = 1 << 27,
SenderPaced = 1L << 31,
SnIncrease = 1 << 26,
/*! <i>Streaming</i> transfer mode.
The server transmits at a throughput sufficient for real-time playback of
audio or video. URIs with audio or video often support the
\ref DH_TransferMode_Interactive and \ref DH_TransferMode_Bulk transfer modes.
The most well-known exception to this general claim is for live streams.
*/
StreamingTransferMode = 1 << 24,
TimeBasedSeek = 1 << 30
}
}

View File

@@ -1,56 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public class DlnaMaps
{
public static readonly string DefaultStreaming =
FlagsToString(DlnaFlags.StreamingTransferMode |
DlnaFlags.BackgroundTransferMode |
DlnaFlags.ConnectionStall |
DlnaFlags.ByteBasedSeek |
DlnaFlags.DlnaV15);
public static readonly string DefaultInteractive =
FlagsToString(DlnaFlags.InteractiveTransferMode |
DlnaFlags.BackgroundTransferMode |
DlnaFlags.ConnectionStall |
DlnaFlags.ByteBasedSeek |
DlnaFlags.DlnaV15);
public static string FlagsToString(DlnaFlags flags)
{
return string.Format("{0:X8}{1:D24}", (ulong)flags, 0);
}
public static string GetOrgOpValue(bool hasKnownRuntime, bool isDirectStream, TranscodeSeekInfo profileTranscodeSeekInfo)
{
if (hasKnownRuntime)
{
string orgOp = string.Empty;
// Time-based seeking currently only possible when transcoding
orgOp += isDirectStream ? "0" : "1";
// Byte-based seeking only possible when not transcoding
orgOp += isDirectStream || profileTranscodeSeekInfo == TranscodeSeekInfo.Bytes ? "1" : "0";
return orgOp;
}
// No seeking is available if we don't know the content runtime
return "00";
}
public static string GetImageOrgOpValue()
{
string orgOp = string.Empty;
// Time-based seeking currently only possible when transcoding
orgOp += "0";
// Byte-based seeking only possible when not transcoding
orgOp += "0";
return orgOp;
}
}
}

View File

@@ -1,9 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public enum DlnaProfileType
{
Audio = 0,
Video = 1,
Photo = 2
}
}

View File

@@ -1,8 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public enum EncodingContext
{
Streaming = 0,
Static = 1
}
}

View File

@@ -1,9 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public enum HeaderMatchType
{
Equals = 0,
Regex = 1,
Substring = 2
}
}

View File

@@ -1,17 +0,0 @@
using System.Xml.Serialization;
using MediaBrowser.Model.Dlna;
namespace MediaBrowser.Model.Dlna
{
public class HttpHeaderInfo
{
[XmlAttribute("name")]
public string Name { get; set; }
[XmlAttribute("value")]
public string Value { get; set; }
[XmlAttribute("match")]
public HeaderMatchType Match { get; set; }
}
}

View File

@@ -1,11 +0,0 @@
using System;
using MediaBrowser.Model.Events;
namespace MediaBrowser.Model.Dlna
{
public interface IDeviceDiscovery
{
event EventHandler<GenericEventArgs<UpnpDeviceInfo>> DeviceDiscovered;
event EventHandler<GenericEventArgs<UpnpDeviceInfo>> DeviceLeft;
}
}

View File

@@ -1,25 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public interface ITranscoderSupport
{
bool CanEncodeToAudioCodec(string codec);
bool CanEncodeToSubtitleCodec(string codec);
bool CanExtractSubtitles(string codec);
}
public class FullTranscoderSupport : ITranscoderSupport
{
public bool CanEncodeToAudioCodec(string codec)
{
return true;
}
public bool CanEncodeToSubtitleCodec(string codec)
{
return true;
}
public bool CanExtractSubtitles(string codec)
{
return true;
}
}
}

View File

@@ -1,113 +0,0 @@

namespace MediaBrowser.Model.Dlna
{
public enum MediaFormatProfile
{
MP3,
WMA_BASE,
WMA_FULL,
LPCM16_44_MONO,
LPCM16_44_STEREO,
LPCM16_48_MONO,
LPCM16_48_STEREO,
AAC_ISO,
AAC_ISO_320,
AAC_ADTS,
AAC_ADTS_320,
FLAC,
OGG,
JPEG_SM,
JPEG_MED,
JPEG_LRG,
JPEG_TN,
PNG_LRG,
PNG_TN,
GIF_LRG,
RAW,
MPEG1,
MPEG_PS_PAL,
MPEG_PS_NTSC,
MPEG_TS_SD_EU,
MPEG_TS_SD_EU_ISO,
MPEG_TS_SD_EU_T,
MPEG_TS_SD_NA,
MPEG_TS_SD_NA_ISO,
MPEG_TS_SD_NA_T,
MPEG_TS_SD_KO,
MPEG_TS_SD_KO_ISO,
MPEG_TS_SD_KO_T,
MPEG_TS_JP_T,
AVI,
MATROSKA,
FLV,
DVR_MS,
WTV,
OGV,
AVC_MP4_MP_SD_AAC_MULT5,
AVC_MP4_MP_SD_MPEG1_L3,
AVC_MP4_MP_SD_AC3,
AVC_MP4_MP_HD_720p_AAC,
AVC_MP4_MP_HD_1080i_AAC,
AVC_MP4_HP_HD_AAC,
AVC_TS_MP_HD_AAC_MULT5,
AVC_TS_MP_HD_AAC_MULT5_T,
AVC_TS_MP_HD_AAC_MULT5_ISO,
AVC_TS_MP_HD_MPEG1_L3,
AVC_TS_MP_HD_MPEG1_L3_T,
AVC_TS_MP_HD_MPEG1_L3_ISO,
AVC_TS_MP_HD_AC3,
AVC_TS_MP_HD_AC3_T,
AVC_TS_MP_HD_AC3_ISO,
AVC_TS_HP_HD_MPEG1_L2_T,
AVC_TS_HP_HD_MPEG1_L2_ISO,
AVC_TS_MP_SD_AAC_MULT5,
AVC_TS_MP_SD_AAC_MULT5_T,
AVC_TS_MP_SD_AAC_MULT5_ISO,
AVC_TS_MP_SD_MPEG1_L3,
AVC_TS_MP_SD_MPEG1_L3_T,
AVC_TS_MP_SD_MPEG1_L3_ISO,
AVC_TS_HP_SD_MPEG1_L2_T,
AVC_TS_HP_SD_MPEG1_L2_ISO,
AVC_TS_MP_SD_AC3,
AVC_TS_MP_SD_AC3_T,
AVC_TS_MP_SD_AC3_ISO,
AVC_TS_HD_DTS_T,
AVC_TS_HD_DTS_ISO,
WMVMED_BASE,
WMVMED_FULL,
WMVMED_PRO,
WMVHIGH_FULL,
WMVHIGH_PRO,
VC1_ASF_AP_L1_WMA,
VC1_ASF_AP_L2_WMA,
VC1_ASF_AP_L3_WMA,
VC1_TS_AP_L1_AC3_ISO,
VC1_TS_AP_L2_AC3_ISO,
VC1_TS_HD_DTS_ISO,
VC1_TS_HD_DTS_T,
MPEG4_P2_MP4_ASP_AAC,
MPEG4_P2_MP4_SP_L6_AAC,
MPEG4_P2_MP4_NDSD,
MPEG4_P2_TS_ASP_AAC,
MPEG4_P2_TS_ASP_AAC_T,
MPEG4_P2_TS_ASP_AAC_ISO,
MPEG4_P2_TS_ASP_MPEG1_L3,
MPEG4_P2_TS_ASP_MPEG1_L3_T,
MPEG4_P2_TS_ASP_MPEG1_L3_ISO,
MPEG4_P2_TS_ASP_MPEG2_L2,
MPEG4_P2_TS_ASP_MPEG2_L2_T,
MPEG4_P2_TS_ASP_MPEG2_L2_ISO,
MPEG4_P2_TS_ASP_AC3,
MPEG4_P2_TS_ASP_AC3_T,
MPEG4_P2_TS_ASP_AC3_ISO,
AVC_TS_HD_50_LPCM_T,
AVC_MP4_LPCM,
MPEG4_P2_3GPP_SP_L0B_AAC,
MPEG4_P2_3GPP_SP_L0B_AMR,
AVC_3GPP_BL_QCIF15_AAC,
MPEG4_H263_3GPP_P0_L10_AMR,
MPEG4_H263_MP4_P0_L10_AAC
}
}

View File

@@ -1,431 +0,0 @@
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.Dlna
{
public class MediaFormatProfileResolver
{
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 MediaFormatProfile[] { val.Value } : new MediaFormatProfile[]{};
}
if (StringHelper.EqualsIgnoreCase(container, "mp4"))
{
MediaFormatProfile? val = ResolveVideoMP4Format(videoCodec, audioCodec, width, height);
return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
}
if (StringHelper.EqualsIgnoreCase(container, "avi"))
return new MediaFormatProfile[] { MediaFormatProfile.AVI };
if (StringHelper.EqualsIgnoreCase(container, "mkv"))
return new MediaFormatProfile[] { MediaFormatProfile.MATROSKA };
if (StringHelper.EqualsIgnoreCase(container, "mpeg2ps") ||
StringHelper.EqualsIgnoreCase(container, "ts"))
return new MediaFormatProfile[] { MediaFormatProfile.MPEG_PS_NTSC, MediaFormatProfile.MPEG_PS_PAL };
if (StringHelper.EqualsIgnoreCase(container, "mpeg1video"))
return new MediaFormatProfile[] { MediaFormatProfile.MPEG1 };
if (StringHelper.EqualsIgnoreCase(container, "mpeg2ts") ||
StringHelper.EqualsIgnoreCase(container, "mpegts") ||
StringHelper.EqualsIgnoreCase(container, "m2ts"))
{
return ResolveVideoMPEG2TSFormat(videoCodec, audioCodec, width, height, timestampType);
}
if (StringHelper.EqualsIgnoreCase(container, "flv"))
return new MediaFormatProfile[] { MediaFormatProfile.FLV };
if (StringHelper.EqualsIgnoreCase(container, "wtv"))
return new MediaFormatProfile[] { MediaFormatProfile.WTV };
if (StringHelper.EqualsIgnoreCase(container, "3gp"))
{
MediaFormatProfile? val = ResolveVideo3GPFormat(videoCodec, audioCodec);
return val.HasValue ? new MediaFormatProfile[] { val.Value } : new MediaFormatProfile[] { };
}
if (StringHelper.EqualsIgnoreCase(container, "ogv") || StringHelper.EqualsIgnoreCase(container, "ogg"))
return new MediaFormatProfile[] { MediaFormatProfile.OGV };
return new MediaFormatProfile[] { };
}
private MediaFormatProfile[] ResolveVideoMPEG2TSFormat(string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
{
string suffix = "";
switch (timestampType)
{
case TransportStreamTimestamp.None:
suffix = "_ISO";
break;
case TransportStreamTimestamp.Valid:
suffix = "_T";
break;
}
string resolution = "S";
if ((width.HasValue && width.Value > 720) || (height.HasValue && height.Value > 576))
{
resolution = "H";
}
if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg2video"))
{
List<MediaFormatProfile> list = new List<MediaFormatProfile>();
list.Add(ValueOf("MPEG_TS_SD_NA" + suffix));
list.Add(ValueOf("MPEG_TS_SD_EU" + suffix));
list.Add(ValueOf("MPEG_TS_SD_KO" + suffix));
if ((timestampType == TransportStreamTimestamp.Valid) && StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
{
list.Add(MediaFormatProfile.MPEG_TS_JP_T);
}
return list.ToArray(list.Count);
}
if (StringHelper.EqualsIgnoreCase(videoCodec, "h264"))
{
if (StringHelper.EqualsIgnoreCase(audioCodec, "lpcm"))
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_50_LPCM_T };
if (StringHelper.EqualsIgnoreCase(audioCodec, "dts"))
{
if (timestampType == TransportStreamTimestamp.None)
{
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_DTS_ISO };
}
return new MediaFormatProfile[] { MediaFormatProfile.AVC_TS_HD_DTS_T };
}
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp2"))
{
if (timestampType == TransportStreamTimestamp.None)
{
return new 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_T", resolution)) };
}
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
return new MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AAC_MULT5{1}", resolution, suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
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 MediaFormatProfile[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AC3{1}", resolution, suffix)) };
}
else if (StringHelper.EqualsIgnoreCase(videoCodec, "vc1"))
{
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "ac3"))
{
if ((width.HasValue && width.Value > 720) || (height.HasValue && height.Value > 576))
{
return new MediaFormatProfile[] { MediaFormatProfile.VC1_TS_AP_L2_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 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 MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AAC{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG1_L3{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp2"))
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG2_L2{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "ac3"))
return new MediaFormatProfile[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AC3{0}", suffix)) };
}
return new MediaFormatProfile[]{};
}
private MediaFormatProfile ValueOf(string value)
{
return (MediaFormatProfile)Enum.Parse(typeof(MediaFormatProfile), value, true);
}
private MediaFormatProfile? ResolveVideoMP4Format(string videoCodec, string audioCodec, int? width, int? height)
{
if (StringHelper.EqualsIgnoreCase(videoCodec, "h264"))
{
if (StringHelper.EqualsIgnoreCase(audioCodec, "lpcm"))
return MediaFormatProfile.AVC_MP4_LPCM;
if (string.IsNullOrEmpty(audioCodec) ||
StringHelper.EqualsIgnoreCase(audioCodec, "ac3"))
{
return MediaFormatProfile.AVC_MP4_MP_SD_AC3;
}
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
{
return MediaFormatProfile.AVC_MP4_MP_SD_MPEG1_L3;
}
if (width.HasValue && height.HasValue)
{
if ((width.Value <= 720) && (height.Value <= 576))
{
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
return MediaFormatProfile.AVC_MP4_MP_SD_AAC_MULT5;
}
else if ((width.Value <= 1280) && (height.Value <= 720))
{
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
return MediaFormatProfile.AVC_MP4_MP_HD_720p_AAC;
}
else if ((width.Value <= 1920) && (height.Value <= 1080))
{
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
{
return MediaFormatProfile.AVC_MP4_MP_HD_1080i_AAC;
}
}
}
}
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg4") ||
StringHelper.EqualsIgnoreCase(videoCodec, "msmpeg4"))
{
if (width.HasValue && height.HasValue && width.Value <= 720 && height.Value <= 576)
{
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
return MediaFormatProfile.MPEG4_P2_MP4_ASP_AAC;
if (StringHelper.EqualsIgnoreCase(audioCodec, "ac3") || StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
{
return MediaFormatProfile.MPEG4_P2_MP4_NDSD;
}
}
else if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
{
return MediaFormatProfile.MPEG4_P2_MP4_SP_L6_AAC;
}
}
else if (StringHelper.EqualsIgnoreCase(videoCodec, "h263") && StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
{
return MediaFormatProfile.MPEG4_H263_MP4_P0_L10_AAC;
}
return null;
}
private MediaFormatProfile? ResolveVideo3GPFormat(string videoCodec, string audioCodec)
{
if (StringHelper.EqualsIgnoreCase(videoCodec, "h264"))
{
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
return MediaFormatProfile.AVC_3GPP_BL_QCIF15_AAC;
}
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg4") ||
StringHelper.EqualsIgnoreCase(videoCodec, "msmpeg4"))
{
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma"))
return MediaFormatProfile.MPEG4_P2_3GPP_SP_L0B_AAC;
if (StringHelper.EqualsIgnoreCase(audioCodec, "amrnb"))
return MediaFormatProfile.MPEG4_P2_3GPP_SP_L0B_AMR;
}
else if (StringHelper.EqualsIgnoreCase(videoCodec, "h263") && StringHelper.EqualsIgnoreCase(audioCodec, "amrnb"))
{
return MediaFormatProfile.MPEG4_H263_3GPP_P0_L10_AMR;
}
return null;
}
private MediaFormatProfile? ResolveVideoASFFormat(string videoCodec, string audioCodec, int? width, int? height)
{
if (StringHelper.EqualsIgnoreCase(videoCodec, "wmv") &&
(string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma") || StringHelper.EqualsIgnoreCase(videoCodec, "wmapro")))
{
if (width.HasValue && height.HasValue)
{
if ((width.Value <= 720) && (height.Value <= 576))
{
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma"))
{
return MediaFormatProfile.WMVMED_FULL;
}
return MediaFormatProfile.WMVMED_PRO;
}
}
if (string.IsNullOrEmpty(audioCodec) || StringHelper.EqualsIgnoreCase(audioCodec, "wma"))
{
return MediaFormatProfile.WMVHIGH_FULL;
}
return MediaFormatProfile.WMVHIGH_PRO;
}
if (StringHelper.EqualsIgnoreCase(videoCodec, "vc1"))
{
if (width.HasValue && height.HasValue)
{
if ((width.Value <= 720) && (height.Value <= 576))
return MediaFormatProfile.VC1_ASF_AP_L1_WMA;
if ((width.Value <= 1280) && (height.Value <= 720))
return MediaFormatProfile.VC1_ASF_AP_L2_WMA;
if ((width.Value <= 1920) && (height.Value <= 1080))
return MediaFormatProfile.VC1_ASF_AP_L3_WMA;
}
}
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg2video"))
{
return MediaFormatProfile.DVR_MS;
}
return null;
}
public MediaFormatProfile? ResolveAudioFormat(string container, int? bitrate, int? frequency, int? channels)
{
if (StringHelper.EqualsIgnoreCase(container, "asf"))
return ResolveAudioASFFormat(bitrate);
if (StringHelper.EqualsIgnoreCase(container, "mp3"))
return MediaFormatProfile.MP3;
if (StringHelper.EqualsIgnoreCase(container, "lpcm"))
return ResolveAudioLPCMFormat(frequency, channels);
if (StringHelper.EqualsIgnoreCase(container, "mp4") ||
StringHelper.EqualsIgnoreCase(container, "aac"))
return ResolveAudioMP4Format(bitrate);
if (StringHelper.EqualsIgnoreCase(container, "adts"))
return ResolveAudioADTSFormat(bitrate);
if (StringHelper.EqualsIgnoreCase(container, "flac"))
return MediaFormatProfile.FLAC;
if (StringHelper.EqualsIgnoreCase(container, "oga") ||
StringHelper.EqualsIgnoreCase(container, "ogg"))
return MediaFormatProfile.OGG;
return null;
}
private MediaFormatProfile ResolveAudioASFFormat(int? bitrate)
{
if (bitrate.HasValue && bitrate.Value <= 193)
{
return MediaFormatProfile.WMA_BASE;
}
return MediaFormatProfile.WMA_FULL;
}
private MediaFormatProfile? ResolveAudioLPCMFormat(int? frequency, int? channels)
{
if (frequency.HasValue && channels.HasValue)
{
if (frequency.Value == 44100 && channels.Value == 1)
{
return MediaFormatProfile.LPCM16_44_MONO;
}
if (frequency.Value == 44100 && channels.Value == 2)
{
return MediaFormatProfile.LPCM16_44_STEREO;
}
if (frequency.Value == 48000 && channels.Value == 1)
{
return MediaFormatProfile.LPCM16_48_MONO;
}
if (frequency.Value == 48000 && channels.Value == 2)
{
return MediaFormatProfile.LPCM16_48_STEREO;
}
return null;
}
return MediaFormatProfile.LPCM16_48_STEREO;
}
private MediaFormatProfile ResolveAudioMP4Format(int? bitrate)
{
if (bitrate.HasValue && bitrate.Value <= 320)
{
return MediaFormatProfile.AAC_ISO_320;
}
return MediaFormatProfile.AAC_ISO;
}
private MediaFormatProfile ResolveAudioADTSFormat(int? bitrate)
{
if (bitrate.HasValue && bitrate.Value <= 320)
{
return MediaFormatProfile.AAC_ADTS_320;
}
return MediaFormatProfile.AAC_ADTS;
}
public MediaFormatProfile? ResolveImageFormat(string container, int? width, int? height)
{
if (StringHelper.EqualsIgnoreCase(container, "jpeg") ||
StringHelper.EqualsIgnoreCase(container, "jpg"))
return ResolveImageJPGFormat(width, height);
if (StringHelper.EqualsIgnoreCase(container, "png"))
return ResolveImagePNGFormat(width, height);
if (StringHelper.EqualsIgnoreCase(container, "gif"))
return MediaFormatProfile.GIF_LRG;
if (StringHelper.EqualsIgnoreCase(container, "raw"))
return MediaFormatProfile.RAW;
return null;
}
private MediaFormatProfile ResolveImageJPGFormat(int? width, int? height)
{
if (width.HasValue && height.HasValue)
{
if ((width.Value <= 160) && (height.Value <= 160))
return MediaFormatProfile.JPEG_TN;
if ((width.Value <= 640) && (height.Value <= 480))
return MediaFormatProfile.JPEG_SM;
if ((width.Value <= 1024) && (height.Value <= 768))
{
return MediaFormatProfile.JPEG_MED;
}
return MediaFormatProfile.JPEG_LRG;
}
return MediaFormatProfile.JPEG_SM;
}
private MediaFormatProfile ResolveImagePNGFormat(int? width, int? height)
{
if (width.HasValue && height.HasValue)
{
if ((width.Value <= 160) && (height.Value <= 160))
return MediaFormatProfile.PNG_TN;
}
return MediaFormatProfile.PNG_LRG;
}
}
}

View File

@@ -1,10 +0,0 @@

namespace MediaBrowser.Model.Dlna
{
public enum PlaybackErrorCode
{
NotAllowed = 0,
NoCompatibleStream = 1,
RateLimitExceeded = 2
}
}

View File

@@ -1,38 +0,0 @@
using System.Xml.Serialization;
namespace MediaBrowser.Model.Dlna
{
public class ProfileCondition
{
[XmlAttribute("condition")]
public ProfileConditionType Condition { get; set; }
[XmlAttribute("property")]
public ProfileConditionValue Property { get; set; }
[XmlAttribute("value")]
public string Value { get; set; }
[XmlAttribute("isRequired")]
public bool IsRequired { get; set; }
public ProfileCondition()
{
IsRequired = true;
}
public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value)
: this(condition, property, value, false)
{
}
public ProfileCondition(ProfileConditionType condition, ProfileConditionValue property, string value, bool isRequired)
{
Condition = condition;
Property = property;
Value = value;
IsRequired = isRequired;
}
}
}

View File

@@ -1,11 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public enum ProfileConditionType
{
Equals = 0,
NotEquals = 1,
LessThanEqual = 2,
GreaterThanEqual = 3,
EqualsAny = 4
}
}

View File

@@ -1,29 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public enum ProfileConditionValue
{
AudioChannels = 0,
AudioBitrate = 1,
AudioProfile = 2,
Width = 3,
Height = 4,
Has64BitOffsets = 5,
PacketLength = 6,
VideoBitDepth = 7,
VideoBitrate = 8,
VideoFramerate = 9,
VideoLevel = 10,
VideoProfile = 11,
VideoTimestamp = 12,
IsAnamorphic = 13,
RefFrames = 14,
NumAudioStreams = 16,
NumVideoStreams = 17,
IsSecondaryAudio = 18,
VideoCodecTag = 19,
IsAvc = 20,
IsInterlaced = 21,
AudioSampleRate = 22,
AudioBitDepth = 23
}
}

View File

@@ -1,14 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public class ResolutionConfiguration
{
public int MaxWidth { get; set; }
public int MaxBitrate { get; set; }
public ResolutionConfiguration(int maxWidth, int maxBitrate)
{
MaxWidth = maxWidth;
MaxBitrate = maxBitrate;
}
}
}

View File

@@ -1,97 +0,0 @@
using System;
using System.Collections.Generic;
using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dlna
{
public class ResolutionNormalizer
{
private static readonly ResolutionConfiguration[] Configurations =
new []
{
new ResolutionConfiguration(426, 320000),
new ResolutionConfiguration(640, 400000),
new ResolutionConfiguration(720, 950000),
new ResolutionConfiguration(1280, 2500000),
new ResolutionConfiguration(1920, 4000000),
new ResolutionConfiguration(3840, 35000000)
};
public static ResolutionOptions Normalize(int? inputBitrate,
int outputBitrate,
string inputCodec,
string outputCodec,
int? maxWidth,
int? maxHeight)
{
// If the bitrate isn't changing, then don't downlscale the resolution
if (inputBitrate.HasValue && outputBitrate >= inputBitrate.Value)
{
if (maxWidth.HasValue || maxHeight.HasValue)
{
return new ResolutionOptions
{
MaxWidth = maxWidth,
MaxHeight = maxHeight
};
}
}
var resolutionConfig = GetResolutionConfiguration(outputBitrate);
if (resolutionConfig != null)
{
var originvalValue = maxWidth;
maxWidth = Math.Min(resolutionConfig.MaxWidth, maxWidth ?? resolutionConfig.MaxWidth);
if (!originvalValue.HasValue || originvalValue.Value != maxWidth.Value)
{
maxHeight = null;
}
}
return new ResolutionOptions
{
MaxWidth = maxWidth,
MaxHeight = maxHeight
};
}
private static ResolutionConfiguration GetResolutionConfiguration(int outputBitrate)
{
ResolutionConfiguration previousOption = null;
foreach (var config in Configurations)
{
if (outputBitrate <= config.MaxBitrate)
{
return previousOption ?? config;
}
previousOption = config;
}
return null;
}
private static double GetVideoBitrateScaleFactor(string codec)
{
if (StringHelper.EqualsIgnoreCase(codec, "h265") ||
StringHelper.EqualsIgnoreCase(codec, "hevc") ||
StringHelper.EqualsIgnoreCase(codec, "vp9"))
{
return .5;
}
return 1;
}
public static int ScaleBitrate(int bitrate, string inputVideoCodec, string outputVideoCodec)
{
var inputScaleFactor = GetVideoBitrateScaleFactor(inputVideoCodec);
var outputScaleFactor = GetVideoBitrateScaleFactor(outputVideoCodec);
var scaleFactor = outputScaleFactor/inputScaleFactor;
var newBitrate = scaleFactor*bitrate;
return Convert.ToInt32(newBitrate);
}
}
}

View File

@@ -1,8 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public class ResolutionOptions
{
public int? MaxWidth { get; set; }
public int? MaxHeight { get; set; }
}
}

View File

@@ -1,49 +0,0 @@
using System.Collections.Generic;
using System.Xml.Serialization;
using MediaBrowser.Model.Dlna;
namespace MediaBrowser.Model.Dlna
{
public class ResponseProfile
{
[XmlAttribute("container")]
public string Container { get; set; }
[XmlAttribute("audioCodec")]
public string AudioCodec { get; set; }
[XmlAttribute("videoCodec")]
public string VideoCodec { get; set; }
[XmlAttribute("type")]
public DlnaProfileType Type { get; set; }
[XmlAttribute("orgPn")]
public string OrgPn { get; set; }
[XmlAttribute("mimeType")]
public string MimeType { get; set; }
public ProfileCondition[] Conditions { get; set; }
public ResponseProfile()
{
Conditions = new ProfileCondition[] {};
}
public string[] GetContainers()
{
return ContainerProfile.SplitValue(Container);
}
public string[] GetAudioCodecs()
{
return ContainerProfile.SplitValue(AudioCodec);
}
public string[] GetVideoCodecs()
{
return ContainerProfile.SplitValue(VideoCodec);
}
}
}

View File

@@ -1,51 +0,0 @@
using MediaBrowser.Model.Extensions;
using System;
namespace MediaBrowser.Model.Dlna
{
public class SearchCriteria
{
public SearchType SearchType { get; set; }
public SearchCriteria(string search)
{
if (string.IsNullOrEmpty(search))
{
throw new ArgumentNullException("search");
}
SearchType = SearchType.Unknown;
String[] factors = StringHelper.RegexSplit(search, "(and|or)");
foreach (String factor in factors)
{
String[] subFactors = StringHelper.RegexSplit(factor.Trim().Trim('(').Trim(')').Trim(), "\\s", 3);
if (subFactors.Length == 3)
{
if (StringHelper.EqualsIgnoreCase("upnp:class", subFactors[0]) &&
(StringHelper.EqualsIgnoreCase("=", subFactors[1]) || StringHelper.EqualsIgnoreCase("derivedfrom", subFactors[1])))
{
if (StringHelper.EqualsIgnoreCase("\"object.item.imageItem\"", subFactors[2]) || StringHelper.EqualsIgnoreCase("\"object.item.imageItem.photo\"", subFactors[2]))
{
SearchType = SearchType.Image;
}
else if (StringHelper.EqualsIgnoreCase("\"object.item.videoItem\"", subFactors[2]))
{
SearchType = SearchType.Video;
}
else if (StringHelper.EqualsIgnoreCase("\"object.container.playlistContainer\"", subFactors[2]))
{
SearchType = SearchType.Playlist;
}
else if (StringHelper.EqualsIgnoreCase("\"object.container.album.musicAlbum\"", subFactors[2]))
{
SearchType = SearchType.MusicAlbum;
}
}
}
}
}
}
}

View File

@@ -1,12 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public enum SearchType
{
Unknown = 0,
Audio = 1,
Image = 2,
Video = 3,
Playlist = 4,
MusicAlbum = 5
}
}

View File

@@ -1,17 +0,0 @@
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Model.Dlna
{
public class SortCriteria
{
public SortOrder SortOrder
{
get { return SortOrder.Ascending; }
}
public SortCriteria(string value)
{
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,60 +0,0 @@
using System;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Session;
using System.Collections.Generic;
using System.Linq;
namespace MediaBrowser.Model.Dlna
{
public class StreamInfoSorter
{
public static StreamInfo[] SortMediaSources(List<StreamInfo> streams, long? maxBitrate)
{
return streams.OrderBy(i =>
{
// Nothing beats direct playing a file
if (i.PlayMethod == PlayMethod.DirectPlay && i.MediaSource.Protocol == MediaProtocol.File)
{
return 0;
}
return 1;
}).ThenBy(i =>
{
switch (i.PlayMethod)
{
// Let's assume direct streaming a file is just as desirable as direct playing a remote url
case PlayMethod.DirectStream:
case PlayMethod.DirectPlay:
return 0;
default:
return 1;
}
}).ThenBy(i =>
{
switch (i.MediaSource.Protocol)
{
case MediaProtocol.File:
return 0;
default:
return 1;
}
}).ThenBy(i =>
{
if (maxBitrate.HasValue)
{
if (i.MediaSource.Bitrate.HasValue)
{
return Math.Abs(i.MediaSource.Bitrate.Value - maxBitrate.Value);
}
}
return 0;
}).ToArray();
}
}
}

View File

@@ -1,22 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public enum SubtitleDeliveryMethod
{
/// <summary>
/// The encode
/// </summary>
Encode = 0,
/// <summary>
/// The embed
/// </summary>
Embed = 1,
/// <summary>
/// The external
/// </summary>
External = 2,
/// <summary>
/// The HLS
/// </summary>
Hls = 3
}
}

View File

@@ -1,43 +0,0 @@
using MediaBrowser.Model.Extensions;
using System.Collections.Generic;
using System.Xml.Serialization;
using MediaBrowser.Model.Dlna;
namespace MediaBrowser.Model.Dlna
{
public class SubtitleProfile
{
[XmlAttribute("format")]
public string Format { get; set; }
[XmlAttribute("method")]
public SubtitleDeliveryMethod Method { get; set; }
[XmlAttribute("didlMode")]
public string DidlMode { get; set; }
[XmlAttribute("language")]
public string Language { get; set; }
public string[] GetLanguages()
{
return ContainerProfile.SplitValue(Language);
}
public bool SupportsLanguage(string subLanguage)
{
if (string.IsNullOrEmpty(Language))
{
return true;
}
if (string.IsNullOrEmpty(subLanguage))
{
subLanguage = "und";
}
var languages = GetLanguages();
return languages.Length == 0 || ListHelper.ContainsIgnoreCase(languages, subLanguage);
}
}
}

View File

@@ -1,15 +0,0 @@
namespace MediaBrowser.Model.Dlna
{
public class SubtitleStreamInfo
{
public string Url { get; set; }
public string Language { get; set; }
public string Name { get; set; }
public bool IsForced { get; set; }
public string Format { get; set; }
public string DisplayTitle { get; set; }
public int Index { get; set; }
public SubtitleDeliveryMethod DeliveryMethod { get; set; }
public bool IsExternalUrl { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More