From 14de062681026157c6917779a51af6fb7046cec2 Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 13 Sep 2015 17:32:02 -0400 Subject: update file system methods --- MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs') diff --git a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs index 181f147b4..55a3983bb 100644 --- a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs @@ -65,7 +65,7 @@ namespace MediaBrowser.MediaEncoding.Encoder .CreateJob(options, IsVideoEncoder, progress, cancellationToken).ConfigureAwait(false); encodingJob.OutputFilePath = GetOutputFilePath(encodingJob); - Directory.CreateDirectory(Path.GetDirectoryName(encodingJob.OutputFilePath)); + FileSystem.CreateDirectory(Path.GetDirectoryName(encodingJob.OutputFilePath)); encodingJob.ReadInputAtNativeFramerate = options.ReadInputAtNativeFramerate; @@ -112,7 +112,7 @@ namespace MediaBrowser.MediaEncoding.Encoder Logger.Info(commandLineLogMessage); var logFilePath = Path.Combine(ConfigurationManager.CommonApplicationPaths.LogDirectoryPath, "transcode-" + Guid.NewGuid() + ".txt"); - Directory.CreateDirectory(Path.GetDirectoryName(logFilePath)); + FileSystem.CreateDirectory(Path.GetDirectoryName(logFilePath)); // FFMpeg writes debug/error info to stderr. This is useful when debugging so let's put it in the log directory. encodingJob.LogFileStream = FileSystem.GetFileStream(logFilePath, FileMode.Create, FileAccess.Write, FileShare.Read, true); @@ -144,7 +144,7 @@ namespace MediaBrowser.MediaEncoding.Encoder new JobLogger(Logger).StartStreamingLog(encodingJob, process.StandardError.BaseStream, encodingJob.LogFileStream); // Wait for the file to exist before proceeeding - while (!File.Exists(encodingJob.OutputFilePath) && !encodingJob.HasExited) + while (!FileSystem.FileExists(encodingJob.OutputFilePath) && !encodingJob.HasExited) { await Task.Delay(100, cancellationToken).ConfigureAwait(false); } -- cgit v1.2.3 From 718545a79b0ba8709609b176ebb3922d6fa8eb6d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 19 Sep 2015 22:06:56 -0400 Subject: update metadata editor --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 11 +++- .../Channels/ChannelVideoItem.cs | 6 ++- .../Channels/IChannelMediaItem.cs | 2 +- MediaBrowser.Controller/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 ++ MediaBrowser.Controller/LiveTv/LiveTvProgram.cs | 5 ++ .../LiveTv/LiveTvVideoRecording.cs | 4 ++ MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs | 48 +++++++++++++++++- MediaBrowser.MediaEncoding/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 +++++ .../Notifications/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 (limited to 'MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs') diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 86f06213c..5d88a41aa 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 ca5e343f8..3a9c1f9d0 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 50df07e72..60a29da90 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 623329ca6..43b980c20 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 807beee52..98d1eb4ce 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