From 718545a79b0ba8709609b176ebb3922d6fa8eb6d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 19 Sep 2015 22:06:56 -0400 Subject: [PATCH] update metadata editor --- .../Playback/BaseStreamingService.cs | 11 +++- .../Channels/ChannelVideoItem.cs | 6 +- .../Channels/IChannelMediaItem.cs | 2 +- .../Entities/Audio/Audio.cs | 21 ++++--- .../Entities/Audio/MusicAlbum.cs | 1 + MediaBrowser.Controller/Entities/BaseItem.cs | 4 +- MediaBrowser.Controller/Entities/TV/Season.cs | 6 +- MediaBrowser.Controller/Entities/Video.cs | 13 ++-- .../LiveTv/LiveTvAudioRecording.cs | 4 ++ .../LiveTv/LiveTvProgram.cs | 5 ++ .../LiveTv/LiveTvVideoRecording.cs | 4 ++ .../Encoder/BaseEncoder.cs | 48 ++++++++++++++- .../Encoder/EncodingJob.cs | 2 +- .../Encoder/EncodingJobFactory.cs | 35 +++++++---- .../MediaInfo/AudioImageProvider.cs | 2 +- .../MediaInfo/FFProbeAudioInfo.cs | 3 +- .../MediaInfo/FFProbeVideoInfo.cs | 4 +- .../LiveTv/LiveTvManager.cs | 20 +++---- ...MediaBrowser.Server.Implementations.csproj | 1 + .../IConfigurableNotificationService.cs | 14 +++++ .../InternalNotificationService.cs | 21 ++++++- .../Notifications/NotificationManager.cs | 23 +++++++- .../Persistence/SqliteItemRepository.cs | 59 ++++++++++++++++--- .../MediaBrowser.WebDashboard.csproj | 6 ++ 24 files changed, 248 insertions(+), 67 deletions(-) create mode 100644 MediaBrowser.Server.Implementations/Notifications/IConfigurableNotificationService.cs diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 86f06213c4..5d88a41aa7 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -839,7 +839,7 @@ namespace MediaBrowser.Api.Playback } // leave blank so ffmpeg will decide - return string.Empty; + return null; } /// @@ -849,7 +849,7 @@ namespace MediaBrowser.Api.Playback /// System.String. protected string GetInputArgument(StreamState state) { - var arg = string.Format("{1}-i {0}", GetInputPathArgument(state), GetVideoDecoder(state)); + var arg = string.Format("-i {0}", GetInputPathArgument(state)); if (state.SubtitleStream != null) { @@ -1060,6 +1060,7 @@ namespace MediaBrowser.Api.Playback var bytes = Encoding.UTF8.GetBytes(Environment.NewLine + line); await target.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false); + await target.FlushAsync().ConfigureAwait(false); } } } @@ -2191,6 +2192,12 @@ namespace MediaBrowser.Api.Playback inputModifier += " -re"; } + var videoDecoder = GetVideoDecoder(state); + if (!string.IsNullOrWhiteSpace(videoDecoder)) + { + inputModifier += " " + videoDecoder; + } + return inputModifier; } diff --git a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs index ca5e343f8c..3a9c1f9d01 100644 --- a/MediaBrowser.Controller/Channels/ChannelVideoItem.cs +++ b/MediaBrowser.Controller/Channels/ChannelVideoItem.cs @@ -115,7 +115,11 @@ namespace MediaBrowser.Controller.Channels var info = GetItemLookupInfo(); info.ContentType = ContentType; - info.ExtraType = ExtraType; + + if (ExtraType.HasValue) + { + info.ExtraType = ExtraType.Value; + } return info; } diff --git a/MediaBrowser.Controller/Channels/IChannelMediaItem.cs b/MediaBrowser.Controller/Channels/IChannelMediaItem.cs index 50df07e72b..60a29da90b 100644 --- a/MediaBrowser.Controller/Channels/IChannelMediaItem.cs +++ b/MediaBrowser.Controller/Channels/IChannelMediaItem.cs @@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.Channels ChannelMediaContentType ContentType { get; set; } - ExtraType ExtraType { get; set; } + ExtraType? ExtraType { get; set; } List ChannelMediaSources { get; set; } } diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index 623329ca66..43b980c20d 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -24,14 +24,20 @@ namespace MediaBrowser.Controller.Entities.Audio IThemeMedia, IArchivable { - public string FormatName { get; set; } public long? Size { get; set; } public string Container { get; set; } public int? TotalBitrate { get; set; } public List Tags { get; set; } - public ExtraType ExtraType { get; set; } + public ExtraType? ExtraType { get; set; } - public bool IsThemeMedia { get; set; } + [IgnoreDataMember] + public bool IsThemeMedia + { + get + { + return ExtraType.HasValue && ExtraType.Value == Model.Entities.ExtraType.ThemeSong; + } + } public Audio() { @@ -46,12 +52,6 @@ namespace MediaBrowser.Controller.Entities.Audio get { return LocationType == LocationType.FileSystem && RunTimeTicks.HasValue; } } - /// - /// Gets or sets a value indicating whether this instance has embedded image. - /// - /// true if this instance has embedded image; otherwise, false. - public bool HasEmbeddedImage { get; set; } - [IgnoreDataMember] protected override bool SupportsOwnedItems { @@ -212,8 +212,7 @@ namespace MediaBrowser.Controller.Entities.Audio Path = enablePathSubstituion ? GetMappedPath(i.Path, locationType) : i.Path, RunTimeTicks = i.RunTimeTicks, Container = i.Container, - Size = i.Size, - Formats = (i.FormatName ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList() + Size = i.Size }; if (string.IsNullOrEmpty(info.Container)) diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index 807beee523..98d1eb4ce2 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -66,6 +66,7 @@ namespace MediaBrowser.Controller.Entities.Audio /// Gets the tracks. /// /// The tracks. + [IgnoreDataMember] public IEnumerable