From f0864b1dae70f31f8e911e2994a07421753361c4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 29 Aug 2016 03:12:34 -0400 Subject: [PATCH 1/2] update intros --- .../Intros/DefaultIntroProvider.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs b/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs index 7c7a535cd..4a43befed 100644 --- a/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs +++ b/MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs @@ -216,7 +216,8 @@ namespace MediaBrowser.Server.Implementations.Intros } return allIntros - .Where(i => IsMatch(i.Path, codec)); + .Where(i => IsMatch(i.Path, codec)) + .OrderBy(i => Guid.NewGuid()); } private IEnumerable GetMediaInfoIntrosByAudioStream(List allIntros, MediaStream stream) @@ -229,13 +230,15 @@ namespace MediaBrowser.Server.Implementations.Intros } return allIntros - .Where(i => IsAudioMatch(i.Path, stream)); + .Where(i => IsAudioMatch(i.Path, stream)) + .OrderBy(i => Guid.NewGuid()); } private IEnumerable GetMediaInfoIntrosByTags(List allIntros, List tags) { return allIntros - .Where(i => tags.Any(t => IsMatch(i.Path, t))); + .Where(i => tags.Any(t => IsMatch(i.Path, t))) + .OrderBy(i => Guid.NewGuid()); } private bool IsMatch(string file, string attribute) From 06ebf9d3c262d64d3d1aa967c7893ae32a4fb191 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 29 Aug 2016 14:42:53 -0400 Subject: [PATCH 2/2] update recording file name --- .../ScheduledTasks/ScheduledTaskWorker.cs | 4 -- .../Configuration/ServerConfiguration.cs | 2 - .../Manager/MetadataService.cs | 15 ------- .../Library/LibraryManager.cs | 4 -- .../Library/Validators/PeopleValidator.cs | 4 -- .../LiveTv/EmbyTV/RecordingHelper.cs | 4 ++ .../ApplicationHost.cs | 3 +- .../MediaBrowser.Server.Startup.Common.csproj | 1 - .../Migrations/CollectionsViewMigration.cs | 40 ------------------- 9 files changed, 5 insertions(+), 72 deletions(-) delete mode 100644 MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs index ab2aa761b..798e18ef5 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs @@ -423,10 +423,6 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks CurrentProgress = null; OnTaskCompleted(startTime, endTime, status, failureException); - - // Bad practice, i know. But we keep a lot in memory, unfortunately. - GC.Collect(2, GCCollectionMode.Forced, true); - GC.Collect(2, GCCollectionMode.Forced, true); } /// diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index a891a422a..abe572cc8 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -176,7 +176,6 @@ namespace MediaBrowser.Model.Configuration public string UICulture { get; set; } public PeopleMetadataOptions PeopleMetadataOptions { get; set; } - public bool FindInternetTrailers { get; set; } public bool SaveMetadataHidden { get; set; } @@ -243,7 +242,6 @@ namespace MediaBrowser.Model.Configuration LibraryMonitorDelay = 60; EnableInternetProviders = true; - FindInternetTrailers = true; PathSubstitutions = new PathSubstitution[] { }; ContentTypes = new NameValuePair[] { }; diff --git a/MediaBrowser.Providers/Manager/MetadataService.cs b/MediaBrowser.Providers/Manager/MetadataService.cs index c535f33ba..a610df427 100644 --- a/MediaBrowser.Providers/Manager/MetadataService.cs +++ b/MediaBrowser.Providers/Manager/MetadataService.cs @@ -647,8 +647,6 @@ namespace MediaBrowser.Providers.Manager if (result.HasMetadata) { - NormalizeRemoteResult(result.Item); - MergeData(result, temp, new List(), false, false); refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataDownload; @@ -673,19 +671,6 @@ namespace MediaBrowser.Providers.Manager return refreshResult; } - private void NormalizeRemoteResult(TItemType item) - { - if (!ServerConfigurationManager.Configuration.FindInternetTrailers) - { - var hasTrailers = item as IHasTrailers; - - if (hasTrailers != null) - { - hasTrailers.RemoteTrailers.Clear(); - } - } - } - private void MergeNewData(TItemType source, TIdType lookupInfo) { // Copy new provider id's that may have been obtained diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index cc3a7e41f..5d556e3a6 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -1088,10 +1088,6 @@ namespace MediaBrowser.Server.Implementations.Library await RunPostScanTasks(innerProgress, cancellationToken).ConfigureAwait(false); progress.Report(100); - - // Bad practice, i know. But we keep a lot in memory, unfortunately. - GC.Collect(2, GCCollectionMode.Forced, true); - GC.Collect(2, GCCollectionMode.Forced, true); } /// diff --git a/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs index d90b9615b..93b9c0da1 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs @@ -165,10 +165,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators progress.Report(100); _logger.Info("People validation complete"); - - // Bad practice, i know. But we keep a lot in memory, unfortunately. - GC.Collect(2, GCCollectionMode.Forced, true); - GC.Collect(2, GCCollectionMode.Forced, true); } } } diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs index 37e10d925..9485e0325 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs @@ -55,6 +55,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV { name += " " + info.OriginalAirDate.Value.ToString("yyyy-MM-dd"); } + else + { + name += " " + DateTime.Now.ToString("yyyy-MM-dd"); + } if (!string.IsNullOrWhiteSpace(info.EpisodeTitle)) { diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 9c5015b0e..ac2422b08 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -385,8 +385,7 @@ namespace MediaBrowser.Server.Startup.Common new OmdbEpisodeProviderMigration(ServerConfigurationManager), new MovieDbEpisodeProviderMigration(ServerConfigurationManager), new DbMigration(ServerConfigurationManager, TaskManager), - new UpdateLevelMigration(ServerConfigurationManager, this, HttpClient, JsonSerializer, _releaseAssetFilename), - new CollectionsViewMigration(ServerConfigurationManager, UserManager) + new UpdateLevelMigration(ServerConfigurationManager, this, HttpClient, JsonSerializer, _releaseAssetFilename) }; foreach (var task in migrations) diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj index 5ee7d49e8..c415dec8a 100644 --- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj +++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj @@ -70,7 +70,6 @@ - diff --git a/MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs deleted file mode 100644 index 3f68ec48b..000000000 --- a/MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Linq; -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Library; - -namespace MediaBrowser.Server.Startup.Common.Migrations -{ - public class CollectionsViewMigration : IVersionMigration - { - private readonly IServerConfigurationManager _config; - private readonly IUserManager _userManager; - - public CollectionsViewMigration(IServerConfigurationManager config, IUserManager userManager) - { - _config = config; - _userManager = userManager; - } - - public void Run() - { - var migrationKey = this.GetType().Name; - var migrationKeyList = _config.Configuration.Migrations.ToList(); - - if (!migrationKeyList.Contains(migrationKey)) - { - if (_config.Configuration.IsStartupWizardCompleted) - { - if (_userManager.Users.Any(i => i.Configuration.DisplayCollectionsView)) - { - _config.Configuration.DisplayCollectionsView = true; - } - } - - migrationKeyList.Add(migrationKey); - _config.Configuration.Migrations = migrationKeyList.ToArray(); - _config.SaveConfiguration(); - } - - } - } -}