From 43bcf7ba1d7a93fb9ad7a839b5a9b415b1a1611f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 1 Jul 2016 11:04:08 -0400 Subject: [PATCH 01/12] reduce repeated deserialization --- .../ScheduledTasks/ScheduledTaskWorker.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs index b34d57c42..dcd3a3025 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs @@ -106,6 +106,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks InitTriggerEvents(); } + private bool _readFromFile = false; /// /// The _last execution result /// @@ -126,7 +127,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks lock (_lastExecutionResultSyncLock) { - if (_lastExecutionResult == null) + if (_lastExecutionResult == null && !_readFromFile) { try { @@ -144,6 +145,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks { Logger.ErrorException("Error deserializing {0}", ex, path); } + _readFromFile = true; } } From 0920c9b3a1f02066573b1fb7c4ba186c0558e5c4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 1 Jul 2016 11:51:35 -0400 Subject: [PATCH 02/12] next up upgrade fixes --- MediaBrowser.Controller/Entities/BaseItem.cs | 4 +-- MediaBrowser.Controller/Entities/TV/Series.cs | 23 +++++++++----- .../Entities/UserViewBuilder.cs | 3 +- .../Library/ILibraryManager.cs | 7 ----- .../Library/LibraryManager.cs | 10 ------ .../TV/TVSeriesManager.cs | 31 +++++++++++++------ .../ApplicationHost.cs | 2 +- 7 files changed, 42 insertions(+), 38 deletions(-) diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 0dd7b3c83..9d1a45689 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1655,7 +1655,7 @@ namespace MediaBrowser.Controller.Entities if (datePlayed.HasValue) { - // Incremenet + // Increment data.PlayCount++; } @@ -1667,7 +1667,7 @@ namespace MediaBrowser.Controller.Entities data.PlaybackPositionTicks = 0; } - data.LastPlayedDate = datePlayed ?? data.LastPlayedDate; + data.LastPlayedDate = datePlayed ?? data.LastPlayedDate ?? DateTime.UtcNow; data.Played = true; await UserDataManager.SaveUserData(user.Id, this, data, UserDataSaveReason.TogglePlayed, CancellationToken.None).ConfigureAwait(false); diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index 1cc496b35..09ddbc6b6 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -111,11 +111,20 @@ namespace MediaBrowser.Controller.Entities.TV } } + private static string GetUniqueSeriesKey(BaseItem series) + { + if (ConfigurationManager.Configuration.SchemaVersion < 97) + { + return series.Id.ToString("N"); + } + return series.PresentationUniqueKey; + } + public override int GetChildCount(User user) { var result = LibraryManager.GetItemsResult(new InternalItemsQuery(user) { - AncestorWithPresentationUniqueKey = PresentationUniqueKey, + AncestorWithPresentationUniqueKey = GetUniqueSeriesKey(this), IncludeItemTypes = new[] { typeof(Season).Name }, SortBy = new[] { ItemSortBy.SortName }, IsVirtualItem = false, @@ -202,7 +211,7 @@ namespace MediaBrowser.Controller.Entities.TV if (query.Recursive) { - query.AncestorWithPresentationUniqueKey = PresentationUniqueKey; + query.AncestorWithPresentationUniqueKey = GetUniqueSeriesKey(this); if (query.SortBy.Length == 0) { query.SortBy = new[] { ItemSortBy.SortName }; @@ -228,7 +237,7 @@ namespace MediaBrowser.Controller.Entities.TV seasons = LibraryManager.GetItemList(new InternalItemsQuery(user) { - AncestorWithPresentationUniqueKey = PresentationUniqueKey, + AncestorWithPresentationUniqueKey = GetUniqueSeriesKey(this), IncludeItemTypes = new[] { typeof(Season).Name }, SortBy = new[] { ItemSortBy.SortName } @@ -257,7 +266,7 @@ namespace MediaBrowser.Controller.Entities.TV { var allItems = LibraryManager.GetItemList(new InternalItemsQuery(user) { - AncestorWithPresentationUniqueKey = PresentationUniqueKey, + AncestorWithPresentationUniqueKey = GetUniqueSeriesKey(this), IncludeItemTypes = new[] { typeof(Episode).Name, typeof(Season).Name }, SortBy = new[] { ItemSortBy.SortName } @@ -354,7 +363,7 @@ namespace MediaBrowser.Controller.Entities.TV { return LibraryManager.GetItemList(new InternalItemsQuery(user) { - AncestorWithPresentationUniqueKey = PresentationUniqueKey, + AncestorWithPresentationUniqueKey = GetUniqueSeriesKey(this), IncludeItemTypes = new[] { typeof(Episode).Name }, SortBy = new[] { ItemSortBy.SortName } @@ -423,7 +432,7 @@ namespace MediaBrowser.Controller.Entities.TV public static IEnumerable FilterEpisodesBySeason(IEnumerable episodes, Season parentSeason, bool includeSpecials) { var seasonNumber = parentSeason.IndexNumber; - var seasonPresentationKey = parentSeason.PresentationUniqueKey; + var seasonPresentationKey = GetUniqueSeriesKey(parentSeason); var supportSpecialsInSeason = includeSpecials && seasonNumber.HasValue && seasonNumber.Value != 0; @@ -443,7 +452,7 @@ namespace MediaBrowser.Controller.Entities.TV if (!episode.ParentIndexNumber.HasValue) { var season = episode.Season; - return season != null && string.Equals(season.PresentationUniqueKey, seasonPresentationKey, StringComparison.OrdinalIgnoreCase); + return season != null && string.Equals(GetUniqueSeriesKey(season), seasonPresentationKey, StringComparison.OrdinalIgnoreCase); } return false; diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index 175a7240c..e2228bcaf 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -20,6 +20,7 @@ using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Configuration; using MediaBrowser.Model.Configuration; +using MoreLinq; namespace MediaBrowser.Controller.Entities { @@ -1200,7 +1201,7 @@ namespace MediaBrowser.Controller.Entities { var user = query.User; - items = libraryManager.ReplaceVideosWithPrimaryVersions(items); + items = items.DistinctBy(i => i.PresentationUniqueKey, StringComparer.OrdinalIgnoreCase); if (query.SortBy.Length > 0) { diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 4e641b005..ad38b9ea5 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -308,13 +308,6 @@ namespace MediaBrowser.Controller.Library /// Task. Task DeleteItem(BaseItem item, DeleteOptions options); - /// - /// Replaces the videos with primary versions. - /// - /// The items. - /// IEnumerable{BaseItem}. - IEnumerable ReplaceVideosWithPrimaryVersions(IEnumerable items); - /// /// Gets the named view. /// diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 4c0514035..9d66455e7 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -526,16 +526,6 @@ namespace MediaBrowser.Server.Implementations.Library return key.GetMD5(); } - public IEnumerable ReplaceVideosWithPrimaryVersions(IEnumerable items) - { - if (items == null) - { - throw new ArgumentNullException("items"); - } - - return items.DistinctBy(i => i.PresentationUniqueKey, StringComparer.OrdinalIgnoreCase); - } - /// /// Ensure supplied item has only one instance throughout /// diff --git a/MediaBrowser.Server.Implementations/TV/TVSeriesManager.cs b/MediaBrowser.Server.Implementations/TV/TVSeriesManager.cs index b65c030f0..d51f61b9a 100644 --- a/MediaBrowser.Server.Implementations/TV/TVSeriesManager.cs +++ b/MediaBrowser.Server.Implementations/TV/TVSeriesManager.cs @@ -7,6 +7,7 @@ using MediaBrowser.Model.Querying; using System; using System.Collections.Generic; using System.Linq; +using MediaBrowser.Controller.Configuration; namespace MediaBrowser.Server.Implementations.TV { @@ -15,12 +16,14 @@ namespace MediaBrowser.Server.Implementations.TV private readonly IUserManager _userManager; private readonly IUserDataManager _userDataManager; private readonly ILibraryManager _libraryManager; + private readonly IServerConfigurationManager _config; - public TVSeriesManager(IUserManager userManager, IUserDataManager userDataManager, ILibraryManager libraryManager) + public TVSeriesManager(IUserManager userManager, IUserDataManager userDataManager, ILibraryManager libraryManager, IServerConfigurationManager config) { _userManager = userManager; _userDataManager = userDataManager; _libraryManager = libraryManager; + _config = config; } public QueryResult GetNextUp(NextUpQuery request) @@ -42,7 +45,7 @@ namespace MediaBrowser.Server.Implementations.TV if (series != null) { - presentationUniqueKey = series.PresentationUniqueKey; + presentationUniqueKey = GetUniqueSeriesKey(series); limit = 1; } } @@ -81,7 +84,7 @@ namespace MediaBrowser.Server.Implementations.TV if (series != null) { - presentationUniqueKey = series.PresentationUniqueKey; + presentationUniqueKey = GetUniqueSeriesKey(series); limit = 1; } } @@ -115,6 +118,15 @@ namespace MediaBrowser.Server.Implementations.TV .Select(i => i.Item1); } + private string GetUniqueSeriesKey(BaseItem series) + { + if (_config.Configuration.SchemaVersion < 97) + { + return series.Id.ToString("N"); + } + return series.PresentationUniqueKey; + } + /// /// Gets the next up. /// @@ -125,7 +137,7 @@ namespace MediaBrowser.Server.Implementations.TV { var lastWatchedEpisode = _libraryManager.GetItemList(new InternalItemsQuery(user) { - AncestorWithPresentationUniqueKey = series.PresentationUniqueKey, + AncestorWithPresentationUniqueKey = GetUniqueSeriesKey(series), IncludeItemTypes = new[] { typeof(Episode).Name }, SortBy = new[] { ItemSortBy.SortName }, SortOrder = SortOrder.Descending, @@ -138,7 +150,7 @@ namespace MediaBrowser.Server.Implementations.TV var firstUnwatchedEpisode = _libraryManager.GetItemList(new InternalItemsQuery(user) { - AncestorWithPresentationUniqueKey = series.PresentationUniqueKey, + AncestorWithPresentationUniqueKey = GetUniqueSeriesKey(series), IncludeItemTypes = new[] { typeof(Episode).Name }, SortBy = new[] { ItemSortBy.SortName }, SortOrder = SortOrder.Ascending, @@ -150,14 +162,13 @@ namespace MediaBrowser.Server.Implementations.TV }).Cast().FirstOrDefault(); - if (lastWatchedEpisode != null) + if (lastWatchedEpisode != null && firstUnwatchedEpisode != null) { var userData = _userDataManager.GetUserData(user, lastWatchedEpisode); - if (userData.LastPlayedDate.HasValue) - { - return new Tuple(firstUnwatchedEpisode, userData.LastPlayedDate.Value, false); - } + var lastWatchedDate = userData.LastPlayedDate ?? DateTime.MinValue.AddDays(1); + + return new Tuple(firstUnwatchedEpisode, lastWatchedDate, false); } // Return the first episode diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 755dec6da..63bdddac9 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -477,7 +477,7 @@ namespace MediaBrowser.Server.Startup.Common ImageProcessor = GetImageProcessor(); RegisterSingleInstance(ImageProcessor); - TVSeriesManager = new TVSeriesManager(UserManager, UserDataManager, LibraryManager); + TVSeriesManager = new TVSeriesManager(UserManager, UserDataManager, LibraryManager, ServerConfigurationManager); RegisterSingleInstance(TVSeriesManager); SyncManager = new SyncManager(LibraryManager, SyncRepository, ImageProcessor, LogManager.GetLogger("SyncManager"), UserManager, () => DtoService, this, TVSeriesManager, () => MediaEncoder, FileSystemManager, () => SubtitleEncoder, ServerConfigurationManager, UserDataManager, () => MediaSourceManager, JsonSerializer, TaskManager); From ed690061ab250d567f342dd4dca741dcc8cf5df2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 1 Jul 2016 11:52:57 -0400 Subject: [PATCH 03/12] 3.1.51 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index c4dd38332..47f93507c 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; //[assembly: AssemblyVersion("3.1.*")] -[assembly: AssemblyVersion("3.1.50")] +[assembly: AssemblyVersion("3.1.51")] From c100f0818c3e882948f26dcdd9d7df461c59fe8f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 1 Jul 2016 12:14:17 -0400 Subject: [PATCH 04/12] update startup wizard --- MediaBrowser.Api/StartupWizardService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index 38a7337ec..dfb82438e 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -117,7 +117,7 @@ namespace MediaBrowser.Api config.EnableCustomPathSubFolders = true; config.EnableStandaloneMusicKeys = true; config.EnableCaseSensitiveItemIds = true; - config.EnableFolderView = true; + //config.EnableFolderView = true; config.SchemaVersion = 97; } From c022b728f8570a89973e7690bfdf80e245aa2690 Mon Sep 17 00:00:00 2001 From: softworkz Date: Fri, 1 Jul 2016 22:03:36 +0200 Subject: [PATCH 05/12] OMDB improvements - Improved parsing of production year (cases like '2001-2003') - Parse writer field as person - Parse director field as person - Parse actors fields as persons --- .../Omdb/OmdbItemProvider.cs | 4 +- MediaBrowser.Providers/Omdb/OmdbProvider.cs | 68 ++++++++++++++++--- .../TV/Omdb/OmdbEpisodeProvider.cs | 2 +- 3 files changed, 62 insertions(+), 12 deletions(-) diff --git a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs index 7a803eb6f..914b775af 100644 --- a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs @@ -226,7 +226,7 @@ namespace MediaBrowser.Providers.Omdb result.Item.SetProviderId(MetadataProviders.Imdb, imdbId); result.HasMetadata = true; - await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).Fetch(result.Item, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false); + await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).Fetch(result, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false); } return result; @@ -265,7 +265,7 @@ namespace MediaBrowser.Providers.Omdb result.Item.SetProviderId(MetadataProviders.Imdb, imdbId); result.HasMetadata = true; - await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).Fetch(result.Item, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false); + await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).Fetch(result, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false); } return result; diff --git a/MediaBrowser.Providers/Omdb/OmdbProvider.cs b/MediaBrowser.Providers/Omdb/OmdbProvider.cs index 397107c74..d3692f7c6 100644 --- a/MediaBrowser.Providers/Omdb/OmdbProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbProvider.cs @@ -3,6 +3,7 @@ using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Serialization; using System; @@ -34,13 +35,16 @@ namespace MediaBrowser.Providers.Omdb _configurationManager = configurationManager; } - public async Task Fetch(BaseItem item, string imdbId, string language, string country, CancellationToken cancellationToken) + public async Task Fetch(MetadataResult itemResult, string imdbId, string language, string country, CancellationToken cancellationToken) + where T :BaseItem { if (string.IsNullOrWhiteSpace(imdbId)) { throw new ArgumentNullException("imdbId"); } + T item = itemResult.Item; + var result = await GetRootObject(imdbId, cancellationToken); // Only take the name and rating if the user's language is set to english, since Omdb has no localization @@ -56,8 +60,8 @@ namespace MediaBrowser.Providers.Omdb int year; - if (!string.IsNullOrEmpty(result.Year) - && int.TryParse(result.Year, NumberStyles.Number, _usCulture, out year) + if (!string.IsNullOrEmpty(result.Year) && result.Year.Length >= 4 + && int.TryParse(result.Year.Substring(0, 4), NumberStyles.Number, _usCulture, out year) && year >= 0) { item.ProductionYear = year; @@ -112,16 +116,19 @@ namespace MediaBrowser.Providers.Omdb item.SetProviderId(MetadataProviders.Imdb, result.imdbID); } - ParseAdditionalMetadata(item, result); + ParseAdditionalMetadata(itemResult, result); } - public async Task FetchEpisodeData(BaseItem item, int episodeNumber, int seasonNumber, string imdbId, string language, string country, CancellationToken cancellationToken) + public async Task FetchEpisodeData(MetadataResult itemResult, int episodeNumber, int seasonNumber, string imdbId, string language, string country, CancellationToken cancellationToken) + where T : BaseItem { if (string.IsNullOrWhiteSpace(imdbId)) { throw new ArgumentNullException("imdbId"); } + T item = itemResult.Item; + var seasonResult = await GetSeasonRootObject(imdbId, seasonNumber, cancellationToken); RootObject result = null; @@ -154,8 +161,8 @@ namespace MediaBrowser.Providers.Omdb int year; - if (!string.IsNullOrEmpty(result.Year) - && int.TryParse(result.Year, NumberStyles.Number, _usCulture, out year) + if (!string.IsNullOrEmpty(result.Year) && result.Year.Length >= 4 + && int.TryParse(result.Year.Substring(0, 4), NumberStyles.Number, _usCulture, out year) && year >= 0) { item.ProductionYear = year; @@ -210,7 +217,7 @@ namespace MediaBrowser.Providers.Omdb item.SetProviderId(MetadataProviders.Imdb, result.imdbID); } - ParseAdditionalMetadata(item, result); + ParseAdditionalMetadata(itemResult, result); return true; } @@ -376,8 +383,11 @@ namespace MediaBrowser.Providers.Omdb return Path.Combine(dataPath, filename); } - private void ParseAdditionalMetadata(BaseItem item, RootObject result) + private void ParseAdditionalMetadata(MetadataResult itemResult, RootObject result) + where T : BaseItem { + T item = itemResult.Item; + // Grab series genres because imdb data is better than tvdb. Leave movies alone // But only do it if english is the preferred language because this data will not be localized if (ShouldFetchGenres(item) && @@ -417,6 +427,46 @@ namespace MediaBrowser.Providers.Omdb // Imdb plots are usually pretty short hasShortOverview.ShortOverview = result.Plot; } + + if (!string.IsNullOrWhiteSpace(result.Director)) + { + var person = new PersonInfo + { + Name = result.Director.Trim(), + Type = PersonType.Director + }; + + itemResult.AddPerson(person); + } + + if (!string.IsNullOrWhiteSpace(result.Writer)) + { + var person = new PersonInfo + { + Name = result.Director.Trim(), + Type = PersonType.Writer + }; + + itemResult.AddPerson(person); + } + + if (!string.IsNullOrWhiteSpace(result.Actors)) + { + var actorList = result.Actors.Split(','); + foreach (var actor in actorList) + { + if (!string.IsNullOrWhiteSpace(actor)) + { + var person = new PersonInfo + { + Name = actor.Trim(), + Type = PersonType.Actor + }; + + itemResult.AddPerson(person); + } + } + } } private bool ShouldFetchGenres(BaseItem item) diff --git a/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs b/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs index 21668f014..64e30f47f 100644 --- a/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs @@ -57,7 +57,7 @@ namespace MediaBrowser.Providers.TV { var seriesImdbId = info.SeriesProviderIds[MetadataProviders.Imdb.ToString()]; - result.HasMetadata = await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).FetchEpisodeData(result.Item, info.IndexNumber.Value, info.ParentIndexNumber.Value, seriesImdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false); + result.HasMetadata = await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).FetchEpisodeData(result, info.IndexNumber.Value, info.ParentIndexNumber.Value, seriesImdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false); } return result; From 3043d0687fb62e67ab6858c82e7afa0e2020b68c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 1 Jul 2016 22:15:56 -0400 Subject: [PATCH 06/12] disable omdb people for now --- MediaBrowser.Providers/Omdb/OmdbProvider.cs | 68 ++++++++++----------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/MediaBrowser.Providers/Omdb/OmdbProvider.cs b/MediaBrowser.Providers/Omdb/OmdbProvider.cs index d3692f7c6..037931300 100644 --- a/MediaBrowser.Providers/Omdb/OmdbProvider.cs +++ b/MediaBrowser.Providers/Omdb/OmdbProvider.cs @@ -428,45 +428,45 @@ namespace MediaBrowser.Providers.Omdb hasShortOverview.ShortOverview = result.Plot; } - if (!string.IsNullOrWhiteSpace(result.Director)) - { - var person = new PersonInfo - { - Name = result.Director.Trim(), - Type = PersonType.Director - }; + //if (!string.IsNullOrWhiteSpace(result.Director)) + //{ + // var person = new PersonInfo + // { + // Name = result.Director.Trim(), + // Type = PersonType.Director + // }; - itemResult.AddPerson(person); - } + // itemResult.AddPerson(person); + //} - if (!string.IsNullOrWhiteSpace(result.Writer)) - { - var person = new PersonInfo - { - Name = result.Director.Trim(), - Type = PersonType.Writer - }; + //if (!string.IsNullOrWhiteSpace(result.Writer)) + //{ + // var person = new PersonInfo + // { + // Name = result.Director.Trim(), + // Type = PersonType.Writer + // }; - itemResult.AddPerson(person); - } + // itemResult.AddPerson(person); + //} - if (!string.IsNullOrWhiteSpace(result.Actors)) - { - var actorList = result.Actors.Split(','); - foreach (var actor in actorList) - { - if (!string.IsNullOrWhiteSpace(actor)) - { - var person = new PersonInfo - { - Name = actor.Trim(), - Type = PersonType.Actor - }; + //if (!string.IsNullOrWhiteSpace(result.Actors)) + //{ + // var actorList = result.Actors.Split(','); + // foreach (var actor in actorList) + // { + // if (!string.IsNullOrWhiteSpace(actor)) + // { + // var person = new PersonInfo + // { + // Name = actor.Trim(), + // Type = PersonType.Actor + // }; - itemResult.AddPerson(person); - } - } - } + // itemResult.AddPerson(person); + // } + // } + //} } private bool ShouldFetchGenres(BaseItem item) From 22601f0a2ef0bdc7b27a3bfd72dd9150152eb7eb Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 1 Jul 2016 22:16:05 -0400 Subject: [PATCH 07/12] reduce stdout redirection --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 4 ++-- MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs | 4 ++-- MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 8 ++++---- .../LiveTv/EmbyTV/EncodedRecorder.cs | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index e6ac990bc..89e62ed9b 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -996,7 +996,7 @@ namespace MediaBrowser.Api.Playback UseShellExecute = false, // Must consume both stdout and stderr or deadlocks may occur - RedirectStandardOutput = true, + //RedirectStandardOutput = true, RedirectStandardError = true, RedirectStandardInput = true, @@ -1063,7 +1063,7 @@ namespace MediaBrowser.Api.Playback } // MUST read both stdout and stderr asynchronously or a deadlock may occurr - process.BeginOutputReadLine(); + //process.BeginOutputReadLine(); // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback Task.Run(() => StartStreamingLog(transcodingJob, state, process.StandardError.BaseStream, state.LogFileStream)); diff --git a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs index 9eb796360..725f0bc6d 100644 --- a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs @@ -81,7 +81,7 @@ namespace MediaBrowser.MediaEncoding.Encoder UseShellExecute = false, // Must consume both stdout and stderr or deadlocks may occur - RedirectStandardOutput = true, + //RedirectStandardOutput = true, RedirectStandardError = true, RedirectStandardInput = true, @@ -133,7 +133,7 @@ namespace MediaBrowser.MediaEncoding.Encoder cancellationToken.Register(() => Cancel(process, encodingJob)); // MUST read both stdout and stderr asynchronously or a deadlock may occurr - process.BeginOutputReadLine(); + //process.BeginOutputReadLine(); // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback new JobLogger(Logger).StartStreamingLog(encodingJob, process.StandardError.BaseStream, encodingJob.LogFileStream); diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 68113c0d1..7834a9feb 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -482,7 +482,7 @@ namespace MediaBrowser.MediaEncoding.Encoder UseShellExecute = false, // Must consume both or ffmpeg may hang due to deadlocks. See comments below. - RedirectStandardOutput = true, + //RedirectStandardOutput = true, RedirectStandardError = true, RedirectStandardInput = true, FileName = FFProbePath, @@ -517,7 +517,7 @@ namespace MediaBrowser.MediaEncoding.Encoder try { - process.BeginErrorReadLine(); + //process.BeginErrorReadLine(); var result = _jsonSerializer.DeserializeFromStream(process.StandardOutput.BaseStream); @@ -612,7 +612,7 @@ namespace MediaBrowser.MediaEncoding.Encoder UseShellExecute = false, // Must consume both or ffmpeg may hang due to deadlocks. See comments below. - RedirectStandardOutput = true, + //RedirectStandardOutput = true, RedirectStandardError = true, RedirectStandardInput = true, FileName = FFMpegPath, @@ -643,7 +643,7 @@ namespace MediaBrowser.MediaEncoding.Encoder try { - process.BeginOutputReadLine(); + //process.BeginOutputReadLine(); using (var reader = new StreamReader(process.StandardError.BaseStream)) { diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs index 21879f6f4..5e428e6f0 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs @@ -139,7 +139,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV UseShellExecute = false, // Must consume both stdout and stderr or deadlocks may occur - RedirectStandardOutput = true, + //RedirectStandardOutput = true, RedirectStandardError = true, RedirectStandardInput = true, @@ -174,7 +174,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV cancellationToken.Register(Stop); // MUST read both stdout and stderr asynchronously or a deadlock may occurr - process.BeginOutputReadLine(); + //process.BeginOutputReadLine(); onStarted(); From fb7a893a5e05a179595f6ecc7c661be6674062c8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 1 Jul 2016 22:29:01 -0400 Subject: [PATCH 08/12] 3.1.52 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index 47f93507c..19f69166d 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; //[assembly: AssemblyVersion("3.1.*")] -[assembly: AssemblyVersion("3.1.51")] +[assembly: AssemblyVersion("3.1.52")] From 1295d1e6948bf67bf3495e6891dd72c034a6e012 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 2 Jul 2016 00:25:34 -0400 Subject: [PATCH 09/12] fix probe stdout --- MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 7834a9feb..38516d720 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -482,8 +482,8 @@ namespace MediaBrowser.MediaEncoding.Encoder UseShellExecute = false, // Must consume both or ffmpeg may hang due to deadlocks. See comments below. - //RedirectStandardOutput = true, - RedirectStandardError = true, + RedirectStandardOutput = true, + //RedirectStandardError = true, RedirectStandardInput = true, FileName = FFProbePath, Arguments = string.Format(args, @@ -612,8 +612,8 @@ namespace MediaBrowser.MediaEncoding.Encoder UseShellExecute = false, // Must consume both or ffmpeg may hang due to deadlocks. See comments below. - //RedirectStandardOutput = true, - RedirectStandardError = true, + RedirectStandardOutput = true, + //RedirectStandardError = true, RedirectStandardInput = true, FileName = FFMpegPath, Arguments = string.Format(args, probeSizeArgument, inputPath, videoStream.Index.ToString(CultureInfo.InvariantCulture)).Trim(), From 9b892e8608a37bf1eec92f0d533839ec04d6ca2b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 2 Jul 2016 00:27:27 -0400 Subject: [PATCH 10/12] 3.1.53 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index 19f69166d..2343f716b 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; //[assembly: AssemblyVersion("3.1.*")] -[assembly: AssemblyVersion("3.1.52")] +[assembly: AssemblyVersion("3.1.53")] From dc49059f1bd731c14a34cd7340968f86c34ebc7c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 2 Jul 2016 17:45:20 -0400 Subject: [PATCH 11/12] fix interlace detection stderr --- MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 38516d720..a78e23669 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -612,8 +612,8 @@ namespace MediaBrowser.MediaEncoding.Encoder UseShellExecute = false, // Must consume both or ffmpeg may hang due to deadlocks. See comments below. - RedirectStandardOutput = true, - //RedirectStandardError = true, + //RedirectStandardOutput = true, + RedirectStandardError = true, RedirectStandardInput = true, FileName = FFMpegPath, Arguments = string.Format(args, probeSizeArgument, inputPath, videoStream.Index.ToString(CultureInfo.InvariantCulture)).Trim(), From ce915f89ad6aa4a53d576325f452f7df404b48e2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 2 Jul 2016 17:47:40 -0400 Subject: [PATCH 12/12] 3.1.54 --- SharedVersion.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedVersion.cs b/SharedVersion.cs index 2343f716b..73dead847 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; //[assembly: AssemblyVersion("3.1.*")] -[assembly: AssemblyVersion("3.1.53")] +[assembly: AssemblyVersion("3.1.54")]