mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-04 03:27:21 -05:00 
			
		
		
		
	
						commit
						d02cedb5b5
					
				@ -423,21 +423,6 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks
 | 
				
			|||||||
            CurrentProgress = null;
 | 
					            CurrentProgress = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            OnTaskCompleted(startTime, endTime, status, failureException);
 | 
					            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);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// Executes the task.
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        /// <param name="cancellationToken">The cancellation token.</param>
 | 
					 | 
				
			||||||
        /// <param name="progress">The progress.</param>
 | 
					 | 
				
			||||||
        /// <returns>Task.</returns>
 | 
					 | 
				
			||||||
        private Task ExecuteTask(CancellationToken cancellationToken, IProgress<double> progress)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            return Task.Run(async () => await ScheduledTask.Execute(cancellationToken, progress).ConfigureAwait(false), cancellationToken);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -176,7 +176,6 @@ namespace MediaBrowser.Model.Configuration
 | 
				
			|||||||
        public string UICulture { get; set; }
 | 
					        public string UICulture { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public PeopleMetadataOptions PeopleMetadataOptions { get; set; }
 | 
					        public PeopleMetadataOptions PeopleMetadataOptions { get; set; }
 | 
				
			||||||
        public bool FindInternetTrailers { get; set; }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool SaveMetadataHidden { get; set; }
 | 
					        public bool SaveMetadataHidden { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -243,7 +242,6 @@ namespace MediaBrowser.Model.Configuration
 | 
				
			|||||||
            LibraryMonitorDelay = 60;
 | 
					            LibraryMonitorDelay = 60;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            EnableInternetProviders = true;
 | 
					            EnableInternetProviders = true;
 | 
				
			||||||
            FindInternetTrailers = true;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            PathSubstitutions = new PathSubstitution[] { };
 | 
					            PathSubstitutions = new PathSubstitution[] { };
 | 
				
			||||||
            ContentTypes = new NameValuePair[] { };
 | 
					            ContentTypes = new NameValuePair[] { };
 | 
				
			||||||
 | 
				
			|||||||
@ -647,8 +647,6 @@ namespace MediaBrowser.Providers.Manager
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                    if (result.HasMetadata)
 | 
					                    if (result.HasMetadata)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        NormalizeRemoteResult(result.Item);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                        MergeData(result, temp, new List<MetadataFields>(), false, false);
 | 
					                        MergeData(result, temp, new List<MetadataFields>(), false, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataDownload;
 | 
					                        refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataDownload;
 | 
				
			||||||
@ -673,19 +671,6 @@ namespace MediaBrowser.Providers.Manager
 | 
				
			|||||||
            return refreshResult;
 | 
					            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)
 | 
					        private void MergeNewData(TItemType source, TIdType lookupInfo)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            // Copy new provider id's that may have been obtained
 | 
					            // Copy new provider id's that may have been obtained
 | 
				
			||||||
 | 
				
			|||||||
@ -1,14 +1,11 @@
 | 
				
			|||||||
using MediaBrowser.Controller.FileOrganization;
 | 
					using MediaBrowser.Common.ScheduledTasks;
 | 
				
			||||||
 | 
					using MediaBrowser.Controller.FileOrganization;
 | 
				
			||||||
using MediaBrowser.Controller.Plugins;
 | 
					using MediaBrowser.Controller.Plugins;
 | 
				
			||||||
using MediaBrowser.Model.Logging;
 | 
					using MediaBrowser.Controller.Session;
 | 
				
			||||||
using System;
 | 
					 | 
				
			||||||
using System.Collections.Generic;
 | 
					 | 
				
			||||||
using System.Linq;
 | 
					 | 
				
			||||||
using System.Text;
 | 
					 | 
				
			||||||
using System.Threading.Tasks;
 | 
					 | 
				
			||||||
using MediaBrowser.Model.Events;
 | 
					using MediaBrowser.Model.Events;
 | 
				
			||||||
using MediaBrowser.Model.FileOrganization;
 | 
					using MediaBrowser.Model.FileOrganization;
 | 
				
			||||||
using MediaBrowser.Controller.Session;
 | 
					using MediaBrowser.Model.Logging;
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
using System.Threading;
 | 
					using System.Threading;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace MediaBrowser.Server.Implementations.FileOrganization
 | 
					namespace MediaBrowser.Server.Implementations.FileOrganization
 | 
				
			||||||
@ -20,11 +17,13 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        private readonly IFileOrganizationService _organizationService;
 | 
					        private readonly IFileOrganizationService _organizationService;
 | 
				
			||||||
        private readonly ISessionManager _sessionManager;
 | 
					        private readonly ISessionManager _sessionManager;
 | 
				
			||||||
 | 
					        private readonly ITaskManager _taskManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public FileOrganizationNotifier(ILogger logger, IFileOrganizationService organizationService, ISessionManager sessionManager)
 | 
					        public FileOrganizationNotifier(ILogger logger, IFileOrganizationService organizationService, ISessionManager sessionManager, ITaskManager taskManager)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _organizationService = organizationService;
 | 
					            _organizationService = organizationService;
 | 
				
			||||||
            _sessionManager = sessionManager;
 | 
					            _sessionManager = sessionManager;
 | 
				
			||||||
 | 
					            _taskManager = taskManager;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void Run()
 | 
					        public void Run()
 | 
				
			||||||
@ -33,34 +32,47 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
 | 
				
			|||||||
            _organizationService.ItemRemoved += _organizationService_ItemRemoved;
 | 
					            _organizationService.ItemRemoved += _organizationService_ItemRemoved;
 | 
				
			||||||
            _organizationService.ItemUpdated += _organizationService_ItemUpdated;
 | 
					            _organizationService.ItemUpdated += _organizationService_ItemUpdated;
 | 
				
			||||||
            _organizationService.LogReset += _organizationService_LogReset;
 | 
					            _organizationService.LogReset += _organizationService_LogReset;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //_taskManager.TaskCompleted += _taskManager_TaskCompleted;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void _organizationService_LogReset(object sender, EventArgs e)
 | 
					        private void _organizationService_LogReset(object sender, EventArgs e)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _sessionManager.SendMessageToAdminSessions("AutoOrganizeUpdate", (FileOrganizationResult)null, CancellationToken.None);
 | 
					            _sessionManager.SendMessageToAdminSessions("AutoOrganize_LogReset", (FileOrganizationResult)null, CancellationToken.None);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void _organizationService_ItemUpdated(object sender, GenericEventArgs<FileOrganizationResult> e)
 | 
					        private void _organizationService_ItemUpdated(object sender, GenericEventArgs<FileOrganizationResult> e)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _sessionManager.SendMessageToAdminSessions("AutoOrganizeUpdate", e.Argument, CancellationToken.None);
 | 
					            _sessionManager.SendMessageToAdminSessions("AutoOrganize_ItemUpdated", e.Argument, CancellationToken.None);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void _organizationService_ItemRemoved(object sender, GenericEventArgs<FileOrganizationResult> e)
 | 
					        private void _organizationService_ItemRemoved(object sender, GenericEventArgs<FileOrganizationResult> e)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _sessionManager.SendMessageToAdminSessions("AutoOrganizeUpdate", (FileOrganizationResult)null, CancellationToken.None);
 | 
					            _sessionManager.SendMessageToAdminSessions("AutoOrganize_ItemRemoved", e.Argument, CancellationToken.None);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void _organizationService_ItemAdded(object sender, GenericEventArgs<FileOrganizationResult> e)
 | 
					        private void _organizationService_ItemAdded(object sender, GenericEventArgs<FileOrganizationResult> e)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _sessionManager.SendMessageToAdminSessions("AutoOrganizeUpdate", (FileOrganizationResult)null, CancellationToken.None);
 | 
					            _sessionManager.SendMessageToAdminSessions("AutoOrganize_ItemAdded", e.Argument, CancellationToken.None);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //private void _taskManager_TaskCompleted(object sender, TaskCompletionEventArgs e)
 | 
				
			||||||
 | 
					        //{
 | 
				
			||||||
 | 
					        //    var taskWithKey = e.Task.ScheduledTask as IHasKey;
 | 
				
			||||||
 | 
					        //    if (taskWithKey != null && taskWithKey.Key == "AutoOrganize")
 | 
				
			||||||
 | 
					        //    {
 | 
				
			||||||
 | 
					        //        _sessionManager.SendMessageToAdminSessions("AutoOrganize_TaskCompleted", (FileOrganizationResult)null, CancellationToken.None);
 | 
				
			||||||
 | 
					        //    }
 | 
				
			||||||
 | 
					        //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void Dispose()
 | 
					        public void Dispose()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _organizationService.ItemAdded -= _organizationService_ItemAdded;
 | 
					            _organizationService.ItemAdded -= _organizationService_ItemAdded;
 | 
				
			||||||
            _organizationService.ItemRemoved -= _organizationService_ItemRemoved;
 | 
					            _organizationService.ItemRemoved -= _organizationService_ItemRemoved;
 | 
				
			||||||
            _organizationService.ItemUpdated -= _organizationService_ItemUpdated;
 | 
					            _organizationService.ItemUpdated -= _organizationService_ItemUpdated;
 | 
				
			||||||
            _organizationService.LogReset -= _organizationService_LogReset;
 | 
					            _organizationService.LogReset -= _organizationService_LogReset;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //_taskManager.TaskCompleted -= _taskManager_TaskCompleted;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -216,7 +216,8 @@ namespace MediaBrowser.Server.Implementations.Intros
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return allIntros
 | 
					            return allIntros
 | 
				
			||||||
                .Where(i => IsMatch(i.Path, codec));
 | 
					                .Where(i => IsMatch(i.Path, codec))
 | 
				
			||||||
 | 
					                .OrderBy(i => Guid.NewGuid());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private IEnumerable<IntroInfo> GetMediaInfoIntrosByAudioStream(List<IntroInfo> allIntros, MediaStream stream)
 | 
					        private IEnumerable<IntroInfo> GetMediaInfoIntrosByAudioStream(List<IntroInfo> allIntros, MediaStream stream)
 | 
				
			||||||
@ -229,13 +230,15 @@ namespace MediaBrowser.Server.Implementations.Intros
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return allIntros
 | 
					            return allIntros
 | 
				
			||||||
                .Where(i => IsAudioMatch(i.Path, stream));
 | 
					                .Where(i => IsAudioMatch(i.Path, stream))
 | 
				
			||||||
 | 
					                .OrderBy(i => Guid.NewGuid());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private IEnumerable<IntroInfo> GetMediaInfoIntrosByTags(List<IntroInfo> allIntros, List<string> tags)
 | 
					        private IEnumerable<IntroInfo> GetMediaInfoIntrosByTags(List<IntroInfo> allIntros, List<string> tags)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return allIntros
 | 
					            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)
 | 
					        private bool IsMatch(string file, string attribute)
 | 
				
			||||||
 | 
				
			|||||||
@ -1088,10 +1088,6 @@ namespace MediaBrowser.Server.Implementations.Library
 | 
				
			|||||||
            await RunPostScanTasks(innerProgress, cancellationToken).ConfigureAwait(false);
 | 
					            await RunPostScanTasks(innerProgress, cancellationToken).ConfigureAwait(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            progress.Report(100);
 | 
					            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);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -165,10 +165,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
 | 
				
			|||||||
            progress.Report(100);
 | 
					            progress.Report(100);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            _logger.Info("People validation complete");
 | 
					            _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);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -55,6 +55,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
 | 
				
			|||||||
                {
 | 
					                {
 | 
				
			||||||
                    name += " " + info.OriginalAirDate.Value.ToString("yyyy-MM-dd");
 | 
					                    name += " " + info.OriginalAirDate.Value.ToString("yyyy-MM-dd");
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    name += " " + DateTime.Now.ToString("yyyy-MM-dd");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (!string.IsNullOrWhiteSpace(info.EpisodeTitle))
 | 
					                if (!string.IsNullOrWhiteSpace(info.EpisodeTitle))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 | 
				
			|||||||
@ -284,19 +284,19 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
 | 
				
			|||||||
                    var capabilitiesElement = deviceElement.Element(n1 + "X_SATIPCAP");
 | 
					                    var capabilitiesElement = deviceElement.Element(n1 + "X_SATIPCAP");
 | 
				
			||||||
                        if (capabilitiesElement != null)
 | 
					                        if (capabilitiesElement != null)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            _capabilities = capabilitiesElement.Value;
 | 
					                            //_capabilities = capabilitiesElement.Value;
 | 
				
			||||||
                            if (capabilitiesElement.Value.Contains(','))
 | 
					                            //if (capabilitiesElement.Value.Contains(','))
 | 
				
			||||||
                            {
 | 
					                            //{
 | 
				
			||||||
                                string[] capabilities = capabilitiesElement.Value.Split(',');
 | 
					                            //    string[] capabilities = capabilitiesElement.Value.Split(',');
 | 
				
			||||||
                                foreach (var capability in capabilities)
 | 
					                            //    foreach (var capability in capabilities)
 | 
				
			||||||
                                {
 | 
					                            //    {
 | 
				
			||||||
                                    ReadCapability(capability);
 | 
					                            //        ReadCapability(capability);
 | 
				
			||||||
                                }
 | 
					                            //    }
 | 
				
			||||||
                            }
 | 
					                            //}
 | 
				
			||||||
                            else
 | 
					                            //else
 | 
				
			||||||
                            {
 | 
					                            //{
 | 
				
			||||||
                                ReadCapability(capabilitiesElement.Value);
 | 
					                            //    ReadCapability(capabilitiesElement.Value);
 | 
				
			||||||
                            }
 | 
					                            //}
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        else
 | 
					                        else
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
 | 
				
			|||||||
@ -123,10 +123,17 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
 | 
				
			|||||||
                {
 | 
					                {
 | 
				
			||||||
                    if (extractImages)
 | 
					                    if (extractImages)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        if (video.VideoType == VideoType.HdDvd || video.VideoType == VideoType.Iso || video.VideoType == VideoType.BluRay || video.VideoType == VideoType.Dvd)
 | 
					                        if (video.VideoType == VideoType.HdDvd || video.VideoType == VideoType.Iso)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            continue;
 | 
					                            continue;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
 | 
					                        if (video.VideoType == VideoType.BluRay || video.VideoType == VideoType.Dvd)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            if (video.PlayableStreamFileNames.Count != 1)
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                continue;
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        // Add some time for the first chapter to make sure we don't end up with a black image
 | 
					                        // Add some time for the first chapter to make sure we don't end up with a black image
 | 
				
			||||||
                        var time = chapter.StartPositionTicks == 0 ? TimeSpan.FromTicks(Math.Min(FirstChapterTicks, video.RunTimeTicks ?? 0)) : TimeSpan.FromTicks(chapter.StartPositionTicks);
 | 
					                        var time = chapter.StartPositionTicks == 0 ? TimeSpan.FromTicks(Math.Min(FirstChapterTicks, video.RunTimeTicks ?? 0)) : TimeSpan.FromTicks(chapter.StartPositionTicks);
 | 
				
			||||||
 | 
				
			|||||||
@ -385,8 +385,7 @@ namespace MediaBrowser.Server.Startup.Common
 | 
				
			|||||||
                new OmdbEpisodeProviderMigration(ServerConfigurationManager),
 | 
					                new OmdbEpisodeProviderMigration(ServerConfigurationManager),
 | 
				
			||||||
                new MovieDbEpisodeProviderMigration(ServerConfigurationManager),
 | 
					                new MovieDbEpisodeProviderMigration(ServerConfigurationManager),
 | 
				
			||||||
                new DbMigration(ServerConfigurationManager, TaskManager),
 | 
					                new DbMigration(ServerConfigurationManager, TaskManager),
 | 
				
			||||||
                new UpdateLevelMigration(ServerConfigurationManager, this, HttpClient, JsonSerializer, _releaseAssetFilename),
 | 
					                new UpdateLevelMigration(ServerConfigurationManager, this, HttpClient, JsonSerializer, _releaseAssetFilename)
 | 
				
			||||||
                new CollectionsViewMigration(ServerConfigurationManager, UserManager)
 | 
					 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            foreach (var task in migrations)
 | 
					            foreach (var task in migrations)
 | 
				
			||||||
 | 
				
			|||||||
@ -70,7 +70,6 @@
 | 
				
			|||||||
    <Compile Include="FFMpeg\FFMpegInfo.cs" />
 | 
					    <Compile Include="FFMpeg\FFMpegInfo.cs" />
 | 
				
			||||||
    <Compile Include="INativeApp.cs" />
 | 
					    <Compile Include="INativeApp.cs" />
 | 
				
			||||||
    <Compile Include="MbLinkShortcutHandler.cs" />
 | 
					    <Compile Include="MbLinkShortcutHandler.cs" />
 | 
				
			||||||
    <Compile Include="Migrations\CollectionsViewMigration.cs" />
 | 
					 | 
				
			||||||
    <Compile Include="Migrations\IVersionMigration.cs" />
 | 
					    <Compile Include="Migrations\IVersionMigration.cs" />
 | 
				
			||||||
    <Compile Include="Migrations\DbMigration.cs" />
 | 
					    <Compile Include="Migrations\DbMigration.cs" />
 | 
				
			||||||
    <Compile Include="Migrations\MovieDbEpisodeProviderMigration.cs" />
 | 
					    <Compile Include="Migrations\MovieDbEpisodeProviderMigration.cs" />
 | 
				
			||||||
 | 
				
			|||||||
@ -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();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -72,19 +72,23 @@ namespace MediaBrowser.XbmcMetadata.Savers
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                writer.WriteElementString("airsbefore_episode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture));
 | 
					                writer.WriteElementString("airsbefore_episode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (episode.AirsBeforeEpisodeNumber.HasValue && episode.AirsBeforeEpisodeNumber.Value != -1)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                writer.WriteElementString("displayepisode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture));
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if (episode.AirsBeforeSeasonNumber.HasValue && episode.AirsBeforeSeasonNumber.Value != -1)
 | 
					            if (episode.AirsBeforeSeasonNumber.HasValue && episode.AirsBeforeSeasonNumber.Value != -1)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                writer.WriteElementString("airsbefore_season", episode.AirsBeforeSeasonNumber.Value.ToString(UsCulture));
 | 
					                writer.WriteElementString("airsbefore_season", episode.AirsBeforeSeasonNumber.Value.ToString(UsCulture));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var season = episode.AiredSeasonNumber;
 | 
					            if (episode.ParentIndexNumber.HasValue && episode.ParentIndexNumber.Value == 0)
 | 
				
			||||||
            if (season.HasValue && season.Value != -1)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                writer.WriteElementString("displayseason", season.Value.ToString(UsCulture));
 | 
					                if (episode.AirsBeforeEpisodeNumber.HasValue && episode.AirsBeforeEpisodeNumber.Value != -1)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    writer.WriteElementString("displayepisode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                var specialSeason = episode.AiredSeasonNumber;
 | 
				
			||||||
 | 
					                if (specialSeason.HasValue && specialSeason.Value != -1)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    writer.WriteElementString("displayseason", specialSeason.Value.ToString(UsCulture));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (episode.DvdEpisodeNumber.HasValue)
 | 
					            if (episode.DvdEpisodeNumber.HasValue)
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,7 @@
 | 
				
			|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
 | 
					<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
 | 
				
			||||||
    <metadata>
 | 
					    <metadata>
 | 
				
			||||||
        <id>MediaBrowser.Common.Internal</id>
 | 
					        <id>MediaBrowser.Common.Internal</id>
 | 
				
			||||||
        <version>3.0.655</version>
 | 
					        <version>3.0.656</version>
 | 
				
			||||||
        <title>MediaBrowser.Common.Internal</title>
 | 
					        <title>MediaBrowser.Common.Internal</title>
 | 
				
			||||||
        <authors>Luke</authors>
 | 
					        <authors>Luke</authors>
 | 
				
			||||||
        <owners>ebr,Luke,scottisafool</owners>
 | 
					        <owners>ebr,Luke,scottisafool</owners>
 | 
				
			||||||
@ -12,7 +12,7 @@
 | 
				
			|||||||
        <description>Contains common components shared by Emby Theater and Emby Server. Not intended for plugin developer consumption.</description>
 | 
					        <description>Contains common components shared by Emby Theater and Emby Server. Not intended for plugin developer consumption.</description>
 | 
				
			||||||
        <copyright>Copyright © Emby 2013</copyright>
 | 
					        <copyright>Copyright © Emby 2013</copyright>
 | 
				
			||||||
        <dependencies>
 | 
					        <dependencies>
 | 
				
			||||||
            <dependency id="MediaBrowser.Common" version="3.0.655" />
 | 
					            <dependency id="MediaBrowser.Common" version="3.0.656" />
 | 
				
			||||||
            <dependency id="NLog" version="4.3.6" />
 | 
					            <dependency id="NLog" version="4.3.6" />
 | 
				
			||||||
            <dependency id="SimpleInjector" version="3.2.0" />
 | 
					            <dependency id="SimpleInjector" version="3.2.0" />
 | 
				
			||||||
        </dependencies>
 | 
					        </dependencies>
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,7 @@
 | 
				
			|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
 | 
					<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
 | 
				
			||||||
    <metadata>
 | 
					    <metadata>
 | 
				
			||||||
        <id>MediaBrowser.Common</id>
 | 
					        <id>MediaBrowser.Common</id>
 | 
				
			||||||
        <version>3.0.655</version>
 | 
					        <version>3.0.656</version>
 | 
				
			||||||
        <title>MediaBrowser.Common</title>
 | 
					        <title>MediaBrowser.Common</title>
 | 
				
			||||||
        <authors>Emby Team</authors>
 | 
					        <authors>Emby Team</authors>
 | 
				
			||||||
        <owners>ebr,Luke,scottisafool</owners>
 | 
					        <owners>ebr,Luke,scottisafool</owners>
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,7 @@
 | 
				
			|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
 | 
					<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
 | 
				
			||||||
    <metadata>
 | 
					    <metadata>
 | 
				
			||||||
        <id>MediaBrowser.Server.Core</id>
 | 
					        <id>MediaBrowser.Server.Core</id>
 | 
				
			||||||
        <version>3.0.655</version>
 | 
					        <version>3.0.656</version>
 | 
				
			||||||
        <title>Media Browser.Server.Core</title>
 | 
					        <title>Media Browser.Server.Core</title>
 | 
				
			||||||
        <authors>Emby Team</authors>
 | 
					        <authors>Emby Team</authors>
 | 
				
			||||||
        <owners>ebr,Luke,scottisafool</owners>
 | 
					        <owners>ebr,Luke,scottisafool</owners>
 | 
				
			||||||
@ -12,7 +12,7 @@
 | 
				
			|||||||
        <description>Contains core components required to build plugins for Emby Server.</description>
 | 
					        <description>Contains core components required to build plugins for Emby Server.</description>
 | 
				
			||||||
        <copyright>Copyright © Emby 2013</copyright>
 | 
					        <copyright>Copyright © Emby 2013</copyright>
 | 
				
			||||||
        <dependencies>
 | 
					        <dependencies>
 | 
				
			||||||
            <dependency id="MediaBrowser.Common" version="3.0.655" />
 | 
					            <dependency id="MediaBrowser.Common" version="3.0.656" />
 | 
				
			||||||
			<dependency id="Interfaces.IO" version="1.0.0.5" />
 | 
								<dependency id="Interfaces.IO" version="1.0.0.5" />
 | 
				
			||||||
        </dependencies>
 | 
					        </dependencies>
 | 
				
			||||||
    </metadata>
 | 
					    </metadata>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
using System.Reflection;
 | 
					using System.Reflection;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//[assembly: AssemblyVersion("3.1.*")]
 | 
					//[assembly: AssemblyVersion("3.1.*")]
 | 
				
			||||||
[assembly: AssemblyVersion("3.0.6300")]
 | 
					[assembly: AssemblyVersion("3.1.128")]
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user