diff options
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/Configuration/LibraryOptions.cs | 1 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/StreamBuilder.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dto/BaseItemDto.cs | 224 | ||||
| -rw-r--r-- | MediaBrowser.Model/LiveTv/LiveTvOptions.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Model/Logging/IConsoleLogger.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.Model/MediaBrowser.Model.csproj | 1 | ||||
| -rw-r--r-- | MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs | 11 | ||||
| -rw-r--r-- | MediaBrowser.Model/Net/MimeTypes.cs | 6 |
8 files changed, 40 insertions, 233 deletions
diff --git a/MediaBrowser.Model/Configuration/LibraryOptions.cs b/MediaBrowser.Model/Configuration/LibraryOptions.cs index 24bc5dd11..7af0acc59 100644 --- a/MediaBrowser.Model/Configuration/LibraryOptions.cs +++ b/MediaBrowser.Model/Configuration/LibraryOptions.cs @@ -14,6 +14,7 @@ public bool EnableInternetProviders { get; set; } public bool ImportMissingEpisodes { get; set; } public bool EnableAutomaticSeriesGrouping { get; set; } + public bool EnableEmbeddedTitles { get; set; } /// <summary> /// Gets or sets the preferred metadata language. diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 129b49cf6..480eb23a5 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -606,9 +606,20 @@ namespace MediaBrowser.Model.Dlna return playlistItem; } + private int GetDefaultAudioBitrateIfUnknown(MediaStream audioStream) + { + if ((audioStream.Channels ?? 0) >= 6) + { + return 384000; + } + + return 192000; + } + private int GetAudioBitrate(string subProtocol, long? maxTotalBitrate, int? targetAudioChannels, string targetAudioCodec, MediaStream audioStream) { - int defaultBitrate = audioStream == null ? 192000 : audioStream.BitRate ?? 192000; + int defaultBitrate = audioStream == null ? 192000 : audioStream.BitRate ?? GetDefaultAudioBitrateIfUnknown(audioStream); + // Reduce the bitrate if we're downmixing if (targetAudioChannels.HasValue && audioStream != null && audioStream.Channels.HasValue && targetAudioChannels.Value < audioStream.Channels.Value) { diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index c69bbb581..c78c92967 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -80,12 +80,8 @@ namespace MediaBrowser.Model.Dto public string PreferredMetadataCountryCode { get; set; } public string AwardSummary { get; set; } - public string ShareUrl { get; set; } public float? Metascore { get; set; } - public bool? HasDynamicCategories { get; set; } - - public int? AnimeSeriesIndex { get; set; } /// <summary> /// Gets or sets a value indicating whether [supports synchronize]. @@ -263,7 +259,7 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the play access. /// </summary> /// <value>The play access.</value> - public PlayAccess PlayAccess { get; set; } + public PlayAccess? PlayAccess { get; set; } /// <summary> /// Gets or sets the aspect ratio. @@ -321,12 +317,6 @@ namespace MediaBrowser.Model.Dto public List<MediaUrl> RemoteTrailers { get; set; } /// <summary> - /// Gets or sets the soundtrack ids. - /// </summary> - /// <value>The soundtrack ids.</value> - public string[] SoundtrackIds { get; set; } - - /// <summary> /// Gets or sets the provider ids. /// </summary> /// <value>The provider ids.</value> @@ -344,15 +334,6 @@ namespace MediaBrowser.Model.Dto /// <value><c>true</c> if this instance is folder; otherwise, <c>false</c>.</value> public bool? IsFolder { get; set; } - [IgnoreDataMember] - public bool IsFolderItem - { - get - { - return IsFolder ?? false; - } - } - /// <summary> /// Gets or sets the parent id. /// </summary> @@ -406,11 +387,6 @@ namespace MediaBrowser.Model.Dto /// </summary> /// <value>The user data.</value> public UserItemDataDto UserData { get; set; } - /// <summary> - /// Gets or sets the season user data. - /// </summary> - /// <value>The season user data.</value> - public UserItemDataDto SeasonUserData { get; set; } /// <summary> /// Gets or sets the recursive item count. @@ -460,56 +436,6 @@ namespace MediaBrowser.Model.Dto /// <value>The status.</value> public string Status { get; set; } - [IgnoreDataMember] - public SeriesStatus? SeriesStatus - { - get - { - if (string.IsNullOrEmpty(Status)) - { - return null; - } - - return (SeriesStatus)Enum.Parse(typeof(SeriesStatus), Status, true); - } - set - { - if (value == null) - { - Status = null; - } - else - { - Status = value.Value.ToString(); - } - } - } - - [IgnoreDataMember] - public RecordingStatus? RecordingStatus - { - get - { - if (string.IsNullOrEmpty(Status)) - { - return null; - } - - return (RecordingStatus)Enum.Parse(typeof(RecordingStatus), Status, true); - } - set - { - if (value == null) - { - Status = null; - } - else - { - Status = value.Value.ToString(); - } - } - } - /// <summary> /// Gets or sets the air time. /// </summary> @@ -523,12 +449,6 @@ namespace MediaBrowser.Model.Dto public List<DayOfWeek> AirDays { get; set; } /// <summary> - /// Gets or sets the index options. - /// </summary> - /// <value>The index options.</value> - public string[] IndexOptions { get; set; } - - /// <summary> /// Gets or sets the tags. /// </summary> /// <value>The tags.</value> @@ -571,12 +491,6 @@ namespace MediaBrowser.Model.Dto public string CollectionType { get; set; } /// <summary> - /// Gets or sets the type of the original collection. - /// </summary> - /// <value>The type of the original collection.</value> - public string OriginalCollectionType { get; set; } - - /// <summary> /// Gets or sets the display order. /// </summary> /// <value>The display order.</value> @@ -653,19 +567,6 @@ namespace MediaBrowser.Model.Dto } /// <summary> - /// Gets or sets a value indicating whether [supports playlists]. - /// </summary> - /// <value><c>true</c> if [supports playlists]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public bool SupportsPlaylists - { - get - { - return RunTimeTicks.HasValue || IsFolderItem || IsGenre || IsMusicGenre || IsArtist; - } - } - - /// <summary> /// Determines whether the specified type is type. /// </summary> /// <param name="type">The type.</param> @@ -759,7 +660,7 @@ namespace MediaBrowser.Model.Dto /// Gets or sets the type of the location. /// </summary> /// <value>The type of the location.</value> - public LocationType LocationType { get; set; } + public LocationType? LocationType { get; set; } /// <summary> /// Gets or sets the type of the iso. @@ -786,18 +687,6 @@ namespace MediaBrowser.Model.Dto public string HomePageUrl { get; set; } /// <summary> - /// Gets or sets the budget. - /// </summary> - /// <value>The budget.</value> - public double? Budget { get; set; } - - /// <summary> - /// Gets or sets the revenue. - /// </summary> - /// <value>The revenue.</value> - public double? Revenue { get; set; } - - /// <summary> /// Gets or sets the locked fields. /// </summary> /// <value>The locked fields.</value> @@ -879,56 +768,6 @@ namespace MediaBrowser.Model.Dto public string SeriesTimerId { get; set; } /// <summary> - /// Gets a value indicating whether this instance can resume. - /// </summary> - /// <value><c>true</c> if this instance can resume; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public bool CanResume - { - get { return UserData != null && UserData.PlaybackPositionTicks > 0; } - } - - /// <summary> - /// Gets the resume position ticks. - /// </summary> - /// <value>The resume position ticks.</value> - [IgnoreDataMember] - public long ResumePositionTicks - { - get { return UserData == null ? 0 : UserData.PlaybackPositionTicks; } - } - - /// <summary> - /// Gets the backdrop count. - /// </summary> - /// <value>The backdrop count.</value> - [IgnoreDataMember] - public int BackdropCount - { - get { return BackdropImageTags == null ? 0 : BackdropImageTags.Count; } - } - - /// <summary> - /// Gets the screenshot count. - /// </summary> - /// <value>The screenshot count.</value> - [IgnoreDataMember] - public int ScreenshotCount - { - get { return ScreenshotImageTags == null ? 0 : ScreenshotImageTags.Count; } - } - - /// <summary> - /// Gets a value indicating whether this instance has banner. - /// </summary> - /// <value><c>true</c> if this instance has banner; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public bool HasBanner - { - get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Banner); } - } - - /// <summary> /// Gets a value indicating whether this instance has art. /// </summary> /// <value><c>true</c> if this instance has art; otherwise, <c>false</c>.</value> @@ -979,46 +818,6 @@ namespace MediaBrowser.Model.Dto } /// <summary> - /// Gets a value indicating whether this instance has disc image. - /// </summary> - /// <value><c>true</c> if this instance has disc image; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public bool HasDiscImage - { - get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Disc); } - } - - /// <summary> - /// Gets a value indicating whether this instance has box image. - /// </summary> - /// <value><c>true</c> if this instance has box image; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public bool HasBoxImage - { - get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Box); } - } - - /// <summary> - /// Gets a value indicating whether this instance has box image. - /// </summary> - /// <value><c>true</c> if this instance has box image; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public bool HasBoxRearImage - { - get { return ImageTags != null && ImageTags.ContainsKey(ImageType.BoxRear); } - } - - /// <summary> - /// Gets a value indicating whether this instance has menu image. - /// </summary> - /// <value><c>true</c> if this instance has menu image; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public bool HasMenuImage - { - get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Menu); } - } - - /// <summary> /// Gets a value indicating whether this instance is video. /// </summary> /// <value><c>true</c> if this instance is video; otherwise, <c>false</c>.</value> @@ -1058,16 +857,6 @@ namespace MediaBrowser.Model.Dto get { return StringHelper.EqualsIgnoreCase(Type, "Person"); } } - /// <summary> - /// Gets a value indicating whether this instance is root. - /// </summary> - /// <value><c>true</c> if this instance is root; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public bool IsRoot - { - get { return StringHelper.EqualsIgnoreCase(Type, "AggregateFolder"); } - } - [IgnoreDataMember] public bool IsMusicGenre { @@ -1104,15 +893,6 @@ namespace MediaBrowser.Model.Dto get { return StringHelper.EqualsIgnoreCase(Type, "Studio"); } } - [IgnoreDataMember] - public bool SupportsSimilarItems - { - get - { - return IsType("Movie") || IsType("Series") || IsType("MusicAlbum") || IsType("MusicArtist") || IsType("Program") || IsType("Recording") || IsType("ChannelVideoItem") || IsType("Game"); - } - } - /// <summary> /// Gets or sets the program identifier. /// </summary> diff --git a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs index 5cf52e0ef..e2c6b0503 100644 --- a/MediaBrowser.Model/LiveTv/LiveTvOptions.cs +++ b/MediaBrowser.Model/LiveTv/LiveTvOptions.cs @@ -48,15 +48,6 @@ namespace MediaBrowser.Model.LiveTv public bool ImportFavoritesOnly { get; set; } public bool AllowHWTranscoding { get; set; } public bool IsEnabled { get; set; } - public string M3UUrl { get; set; } - public string InfoUrl { get; set; } - public string FriendlyName { get; set; } - public int Tuners { get; set; } - public string DiseqC { get; set; } - public string SourceA { get; set; } - public string SourceB { get; set; } - public string SourceC { get; set; } - public string SourceD { get; set; } public bool EnableTvgId { get; set; } public TunerHostInfo() @@ -85,6 +76,7 @@ namespace MediaBrowser.Model.LiveTv public string[] MovieCategories { get; set; } public NameValuePair[] ChannelMappings { get; set; } public string MoviePrefix { get; set; } + public bool EnableNewProgramIds { get; set; } public ListingsProviderInfo() { diff --git a/MediaBrowser.Model/Logging/IConsoleLogger.cs b/MediaBrowser.Model/Logging/IConsoleLogger.cs new file mode 100644 index 000000000..a8c282d65 --- /dev/null +++ b/MediaBrowser.Model/Logging/IConsoleLogger.cs @@ -0,0 +1,7 @@ +namespace MediaBrowser.Model.Logging +{ + public interface IConsoleLogger + { + void WriteLine(string message); + } +} diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index c50ee984e..b796effa1 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -135,6 +135,7 @@ <Compile Include="Dto\MetadataEditorInfo.cs" /> <Compile Include="Dto\NameIdPair.cs" /> <Compile Include="Dto\NameValuePair.cs" /> + <Compile Include="Logging\IConsoleLogger.cs" /> <Compile Include="Net\IpEndPointInfo.cs" /> <Compile Include="Net\ISocket.cs" /> <Compile Include="Net\ISocketFactory.cs" /> diff --git a/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs b/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs index fc4714be3..57a2254b0 100644 --- a/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs +++ b/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs @@ -23,5 +23,16 @@ namespace MediaBrowser.Model.MediaInfo public string LiveStreamId { get; set; } public DeviceProfile DeviceProfile { get; set; } + + public bool EnableDirectPlay { get; set; } + public bool EnableDirectStream { get; set; } + public bool EnableTranscoding { get; set; } + + public PlaybackInfoRequest() + { + EnableDirectPlay = true; + EnableDirectStream = true; + EnableTranscoding = true; + } } } diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs index 2c059c860..902253e80 100644 --- a/MediaBrowser.Model/Net/MimeTypes.cs +++ b/MediaBrowser.Model/Net/MimeTypes.cs @@ -243,7 +243,11 @@ namespace MediaBrowser.Model.Net if (StringHelper.EqualsIgnoreCase(ext, ".opus")) { return "audio/ogg"; - } + } + if (StringHelper.EqualsIgnoreCase(ext, ".ac3")) + { + return "audio/ac3"; + } // Playlists if (StringHelper.EqualsIgnoreCase(ext, ".m3u8")) |
