diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library')
3 files changed, 38 insertions, 37 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs index 98a87d03d..c830c13b8 100644 --- a/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs +++ b/MediaBrowser.Server.Implementations/Library/CoreResolutionIgnoreRule.cs @@ -17,17 +17,15 @@ namespace MediaBrowser.Server.Implementations.Library /// <summary> /// Any folder named in this list will be ignored - can be added to at runtime for extensibility /// </summary> - private static readonly Dictionary<string,string> IgnoreFolders = new List<string> + private static readonly Dictionary<string, string> IgnoreFolders = new List<string> { - "metadata", - "certificate", - "backup", - "ps3_update", - "ps3_vprm", - "adv_obj", - "extrafanart", - "extrathumbs", - ".actors" + "metadata", + "ps3_update", + "ps3_vprm", + "extrafanart", + "extrathumbs", + ".actors", + ".wd_tv" }.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase); @@ -51,7 +49,7 @@ namespace MediaBrowser.Server.Implementations.Library // https://github.com/MediaBrowser/MediaBrowser/issues/427 if (filename.IndexOf("._", StringComparison.OrdinalIgnoreCase) == 0) { - return true; + return true; } // Ignore hidden files and folders diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index b42541204..a06e03c4a 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -1312,7 +1312,8 @@ namespace MediaBrowser.Server.Implementations.Library /// <returns>Task.</returns> public async Task UpdateItem(BaseItem item, ItemUpdateType updateReason, CancellationToken cancellationToken) { - if (item.LocationType == LocationType.FileSystem) + var locationType = item.LocationType; + if (locationType != LocationType.Remote && locationType != LocationType.Virtual) { await _providerManagerFactory().SaveMetadata(item, updateReason).ConfigureAwait(false); } diff --git a/MediaBrowser.Server.Implementations/Library/Validators/CountHelpers.cs b/MediaBrowser.Server.Implementations/Library/Validators/CountHelpers.cs index 679eadb12..edb4e7382 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/CountHelpers.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/CountHelpers.cs @@ -13,51 +13,46 @@ namespace MediaBrowser.Server.Implementations.Library.Validators /// </summary> internal static class CountHelpers { - /// <summary> - /// Adds to dictionary. - /// </summary> - /// <param name="item">The item.</param> - /// <param name="counts">The counts.</param> - internal static void AddToDictionary(BaseItem item, Dictionary<CountType, int> counts) + private static CountType? GetCountType(BaseItem item) { if (item is Movie) { - IncrementCount(counts, CountType.Movie); + return CountType.Movie; } - else if (item is Trailer) + if (item is Episode) { - IncrementCount(counts, CountType.Trailer); + return CountType.Episode; } - else if (item is Series) + if (item is Game) { - IncrementCount(counts, CountType.Series); + return CountType.Game; } - else if (item is Game) + if (item is Audio) { - IncrementCount(counts, CountType.Game); + return CountType.Song; } - else if (item is Audio) + if (item is Trailer) { - IncrementCount(counts, CountType.Song); + return CountType.Trailer; } - else if (item is MusicAlbum) + if (item is Series) { - IncrementCount(counts, CountType.MusicAlbum); + return CountType.Series; } - else if (item is Episode) + if (item is MusicAlbum) { - IncrementCount(counts, CountType.Episode); + return CountType.MusicAlbum; } - else if (item is MusicVideo) + if (item is MusicVideo) { - IncrementCount(counts, CountType.MusicVideo); + return CountType.MusicVideo; } - else if (item is AdultVideo) + if (item is AdultVideo) { - IncrementCount(counts, CountType.AdultVideo); + return CountType.AdultVideo; } - IncrementCount(counts, CountType.Total); + return null; } /// <summary> @@ -129,6 +124,8 @@ namespace MediaBrowser.Server.Implementations.Library.Validators /// <param name="masterDictionary">The master dictionary.</param> internal static void SetItemCounts(Guid userId, BaseItem media, IEnumerable<string> names, Dictionary<string, Dictionary<Guid, Dictionary<CountType, int>>> masterDictionary) { + var countType = GetCountType(media); + foreach (var name in names) { Dictionary<Guid, Dictionary<CountType, int>> libraryCounts; @@ -148,7 +145,12 @@ namespace MediaBrowser.Server.Implementations.Library.Validators libraryCounts.Add(userLibId, userDictionary); } - AddToDictionary(media, userDictionary); + if (countType.HasValue) + { + IncrementCount(userDictionary, countType.Value); + } + + IncrementCount(userDictionary, CountType.Total); } } } |
