diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 3062c00e7b..c4917b0d1f 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1124,6 +1124,11 @@ namespace MediaBrowser.Controller.Entities rating = OfficialRatingForComparison; } + if (string.IsNullOrWhiteSpace(rating)) + { + return null; + } + return LocalizationManager.GetRatingLevel(rating); } diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs index c9603c7e31..227a6bd0e4 100644 --- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs +++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; -using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Entities; using System; +using System.Collections.Generic; namespace MediaBrowser.Controller.Entities { diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 8232c5c7ad..b54a7aaeeb 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -227,5 +227,19 @@ namespace MediaBrowser.Controller.LiveTv info.IsMovie = IsMovie; return info; } + + public override bool SupportsPeople + { + get + { + // Optimization + if (IsNews || IsSports) + { + return false; + } + + return base.SupportsPeople; + } + } } } diff --git a/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs b/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs index e4a2cd007b..826711e51d 100644 --- a/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs +++ b/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs @@ -7,24 +7,6 @@ namespace MediaBrowser.Controller.MediaEncoding { public interface ISubtitleEncoder { - /// - /// Converts the subtitles. - /// - /// The stream. - /// The input format. - /// The output format. - /// The start time ticks. - /// The end time ticks. - /// The cancellation token. - /// Task{Stream}. - Task ConvertSubtitles( - Stream stream, - string inputFormat, - string outputFormat, - long startTimeTicks, - long? endTimeTicks, - CancellationToken cancellationToken); - /// /// Gets the subtitles. /// diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index 60b70ad083..fe616c63e1 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -53,7 +53,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles } } - public async Task ConvertSubtitles(Stream stream, + private async Task ConvertSubtitles(Stream stream, string inputFormat, string outputFormat, long startTimeTicks, @@ -64,7 +64,9 @@ namespace MediaBrowser.MediaEncoding.Subtitles try { - var trackInfo = await GetTrackInfo(stream, inputFormat, cancellationToken).ConfigureAwait(false); + var reader = GetReader(inputFormat, true); + + var trackInfo = reader.Parse(stream, cancellationToken); FilterEvents(trackInfo, startTimeTicks, endTimeTicks, false); @@ -190,7 +192,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles { throw new ArgumentNullException("charset"); } - + try { return Encoding.GetEncoding(charset); @@ -257,15 +259,6 @@ namespace MediaBrowser.MediaEncoding.Subtitles return new Tuple(subtitleStream.Path, protocol, currentFormat, true); } - private async Task GetTrackInfo(Stream stream, - string inputFormat, - CancellationToken cancellationToken) - { - var reader = GetReader(inputFormat, true); - - return reader.Parse(stream, cancellationToken); - } - private ISubtitleParser GetReader(string format, bool throwIfMissing) { if (string.IsNullOrEmpty(format)) diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs index d6a1be9623..26ccdfc9a4 100644 --- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs +++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.IO; +using System.ComponentModel; +using MediaBrowser.Common.IO; using MediaBrowser.Common.ScheduledTasks; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; @@ -338,7 +339,7 @@ namespace MediaBrowser.Server.Implementations.IO } catch { - + } finally { @@ -370,6 +371,17 @@ namespace MediaBrowser.Server.Implementations.IO Logger.ErrorException("Error in Directory watcher for: " + dw.Path, ex); DisposeWatcher(dw); + + if (ex is Win32Exception) + { + Logger.Info("Disabling realtime monitor to prevent future instability"); + + if (ConfigurationManager.Configuration.EnableLibraryMonitor == AutoOnOff.Auto) + { + ConfigurationManager.Configuration.EnableLibraryMonitor = AutoOnOff.Disabled; + Stop(); + } + } } /// diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 8d51e3e92a..497a198fd4 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -2071,14 +2071,17 @@ namespace MediaBrowser.Server.Implementations.Library public List GetPeople(BaseItem item) { - var people = GetPeople(new InternalPeopleQuery + if (item.SupportsPeople) { - ItemId = item.Id - }); + var people = GetPeople(new InternalPeopleQuery + { + ItemId = item.Id + }); - if (people.Count > 0) - { - return people; + if (people.Count > 0) + { + return people; + } } return item.People ?? new List(); diff --git a/MediaBrowser.Server.Implementations/Localization/Core/core.json b/MediaBrowser.Server.Implementations/Localization/Core/core.json index 44a10f0a94..4eb66929d8 100644 --- a/MediaBrowser.Server.Implementations/Localization/Core/core.json +++ b/MediaBrowser.Server.Implementations/Localization/Core/core.json @@ -173,7 +173,5 @@ "HeaderProducer": "Producers", "HeaderWriter": "Writers", "HeaderParentalRatings": "Parental Ratings", - "HeaderCommunityRatings": "Community ratings", - - + "HeaderCommunityRatings": "Community ratings" } diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index f585a7c26a..3e67540d80 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -204,6 +204,7 @@ PreserveNewest + PreserveNewest