From 6aa3313bc05fe5a26cee8944c00489c022612069 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 4 Nov 2015 18:49:06 -0500 Subject: make sure ._ osx files are properly ignored --- .../Library/CoreResolutionIgnoreRule.cs | 63 ++++++++++++---------- 1 file changed, 36 insertions(+), 27 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs') diff --git a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs index 9035d6479..043996403 100644 --- a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs +++ b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -47,11 +47,14 @@ namespace MediaBrowser.Server.Implementations.Library /// /// Shoulds the ignore. /// - /// The args. + /// The file information. + /// The parent. /// true if XXXX, false otherwise - public bool ShouldIgnore(ItemResolveArgs args) + public bool ShouldIgnore(FileSystemMetadata fileInfo, BaseItem parent) { - var filename = args.FileInfo.Name; + var filename = fileInfo.Name; + var isHidden = (fileInfo.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden; + var path = fileInfo.FullName; // Handle mac .DS_Store // https://github.com/MediaBrowser/MediaBrowser/issues/427 @@ -61,21 +64,24 @@ namespace MediaBrowser.Server.Implementations.Library } // Ignore hidden files and folders - if (args.IsHidden) + if (isHidden) { - var parentFolderName = Path.GetFileName(Path.GetDirectoryName(args.Path)); - - if (string.Equals(parentFolderName, BaseItem.ThemeSongsFolderName, StringComparison.OrdinalIgnoreCase)) - { - return false; - } - if (string.Equals(parentFolderName, BaseItem.ThemeVideosFolderName, StringComparison.OrdinalIgnoreCase)) + if (parent != null) { - return false; + var parentFolderName = Path.GetFileName(Path.GetDirectoryName(path)); + + if (string.Equals(parentFolderName, BaseItem.ThemeSongsFolderName, StringComparison.OrdinalIgnoreCase)) + { + return false; + } + if (string.Equals(parentFolderName, BaseItem.ThemeVideosFolderName, StringComparison.OrdinalIgnoreCase)) + { + return false; + } } // Sometimes these are marked hidden - if (_fileSystem.IsRootPath(args.Path)) + if (_fileSystem.IsRootPath(path)) { return false; } @@ -83,7 +89,7 @@ namespace MediaBrowser.Server.Implementations.Library return true; } - if (args.IsDirectory) + if (fileInfo.IsDirectory) { // Ignore any folders in our list if (IgnoreFolders.Contains(filename, StringComparer.OrdinalIgnoreCase)) @@ -91,26 +97,29 @@ namespace MediaBrowser.Server.Implementations.Library return true; } - // Ignore trailer folders but allow it at the collection level - if (string.Equals(filename, BaseItem.TrailerFolderName, StringComparison.OrdinalIgnoreCase) && - !(args.Parent is AggregateFolder) && !(args.Parent is UserRootFolder)) + if (parent != null) { - return true; - } + // Ignore trailer folders but allow it at the collection level + if (string.Equals(filename, BaseItem.TrailerFolderName, StringComparison.OrdinalIgnoreCase) && + !(parent is AggregateFolder) && !(parent is UserRootFolder)) + { + return true; + } - if (string.Equals(filename, BaseItem.ThemeVideosFolderName, StringComparison.OrdinalIgnoreCase)) - { - return true; - } + if (string.Equals(filename, BaseItem.ThemeVideosFolderName, StringComparison.OrdinalIgnoreCase)) + { + return true; + } - if (string.Equals(filename, BaseItem.ThemeSongsFolderName, StringComparison.OrdinalIgnoreCase)) - { - return true; + if (string.Equals(filename, BaseItem.ThemeSongsFolderName, StringComparison.OrdinalIgnoreCase)) + { + return true; + } } } else { - if (args.Parent != null) + if (parent != null) { // Don't resolve these into audio files if (string.Equals(_fileSystem.GetFileNameWithoutExtension(filename), BaseItem.ThemeSongFilename) && _libraryManager.IsAudioFile(filename)) -- cgit v1.2.3 From 7760f022af8230cada08d500682aa2dbaff4d8cc Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 8 Nov 2015 00:04:38 -0500 Subject: fix theme videos --- MediaBrowser.Api/ApiEntryPoint.cs | 18 ++++++++---------- MediaBrowser.Controller/Entities/UserView.cs | 9 +++++++-- MediaBrowser.Model/Configuration/ChapterOptions.cs | 3 +-- .../Configuration/ServerConfiguration.cs | 1 + MediaBrowser.Providers/Manager/ItemImageProvider.cs | 10 ++++++++++ .../Library/CoreResolutionIgnoreRule.cs | 2 +- 6 files changed, 28 insertions(+), 15 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs') diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs index 7f4db5a89..1abbce408 100644 --- a/MediaBrowser.Api/ApiEntryPoint.cs +++ b/MediaBrowser.Api/ApiEntryPoint.cs @@ -709,7 +709,10 @@ namespace MediaBrowser.Api public void StartKillTimer(TimerCallback callback, int intervalMs) { - CheckHasExited(); + if (HasExited) + { + return; + } lock (_timerLock) { @@ -728,7 +731,10 @@ namespace MediaBrowser.Api public void ChangeKillTimerIfStarted() { - CheckHasExited(); + if (HasExited) + { + return; + } lock (_timerLock) { @@ -741,14 +747,6 @@ namespace MediaBrowser.Api } } } - - private void CheckHasExited() - { - if (HasExited) - { - throw new ObjectDisposedException("Job"); - } - } } /// diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.cs index c5b65f5a8..940e99f12 100644 --- a/MediaBrowser.Controller/Entities/UserView.cs +++ b/MediaBrowser.Controller/Entities/UserView.cs @@ -17,7 +17,7 @@ namespace MediaBrowser.Controller.Entities public Guid DisplayParentId { get; set; } public Guid? UserId { get; set; } - + public static ITVSeriesManager TVSeriesManager; public static IPlaylistManager PlaylistManager; @@ -40,7 +40,7 @@ namespace MediaBrowser.Controller.Entities } return list; } - + public override Task> GetItems(InternalItemsQuery query) { var parent = this as Folder; @@ -146,6 +146,11 @@ namespace MediaBrowser.Controller.Entities return types.Contains(viewType ?? string.Empty, StringComparer.OrdinalIgnoreCase); } + protected override Task ValidateChildrenInternal(IProgress progress, System.Threading.CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, Providers.MetadataRefreshOptions refreshOptions, Providers.IDirectoryService directoryService) + { + return Task.FromResult(true); + } + [IgnoreDataMember] public override bool SupportsPeople { diff --git a/MediaBrowser.Model/Configuration/ChapterOptions.cs b/MediaBrowser.Model/Configuration/ChapterOptions.cs index fd3930704..f9ff6b4f9 100644 --- a/MediaBrowser.Model/Configuration/ChapterOptions.cs +++ b/MediaBrowser.Model/Configuration/ChapterOptions.cs @@ -13,11 +13,10 @@ public string[] DisabledFetchers { get; set; } public bool ExtractDuringLibraryScan { get; set; } - + public ChapterOptions() { DownloadMovieChapters = true; - ExtractDuringLibraryScan = true; DisabledFetchers = new string[] { }; FetcherOrder = new string[] { }; diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index ec024e87c..d36174f65 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -235,6 +235,7 @@ namespace MediaBrowser.Model.Configuration public string[] Migrations { get; set; } public int MigrationVersion { get; set; } + public bool EnableImagePreDownloading { get; set; } /// /// Initializes a new instance of the class. diff --git a/MediaBrowser.Providers/Manager/ItemImageProvider.cs b/MediaBrowser.Providers/Manager/ItemImageProvider.cs index f13fb2613..0533e6ca0 100644 --- a/MediaBrowser.Providers/Manager/ItemImageProvider.cs +++ b/MediaBrowser.Providers/Manager/ItemImageProvider.cs @@ -17,6 +17,7 @@ using System.Net; using System.Threading; using System.Threading.Tasks; using CommonIO; +using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Model.MediaInfo; namespace MediaBrowser.Providers.Manager @@ -510,6 +511,15 @@ namespace MediaBrowser.Providers.Manager return true; } + if (item is IItemByName && !(item is MusicArtist)) + { + var hasDualAccess = item as IHasDualAccess; + if (hasDualAccess == null || hasDualAccess.IsAccessedByName) + { + return !_config.Configuration.EnableImagePreDownloading; + } + } + return false; } diff --git a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs index 043996403..402fa439d 100644 --- a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs +++ b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -66,7 +66,7 @@ namespace MediaBrowser.Server.Implementations.Library // Ignore hidden files and folders if (isHidden) { - if (parent != null) + if (parent == null) { var parentFolderName = Path.GetFileName(Path.GetDirectoryName(path)); -- cgit v1.2.3