Backport pull request #11673 from jellyfin/release-10.9.z

Fix local playlist scanning

Original-merge: 26714e2c62

Merged-by: nielsvanvelzen <nielsvanvelzen@users.noreply.github.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
Shadowghost 2024-05-17 13:51:50 -04:00 committed by Joshua M. Boniface
parent a7b2b92f2b
commit 8b938e2696
5 changed files with 17 additions and 9 deletions

View File

@ -11,7 +11,6 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Querying;
namespace Emby.Server.Implementations.Images namespace Emby.Server.Implementations.Images
{ {
@ -33,12 +32,12 @@ namespace Emby.Server.Implementations.Images
Parent = item, Parent = item,
Recursive = true, Recursive = true,
DtoOptions = new DtoOptions(true), DtoOptions = new DtoOptions(true),
ImageTypes = new ImageType[] { ImageType.Primary }, ImageTypes = [ImageType.Primary],
OrderBy = new (ItemSortBy, SortOrder)[] OrderBy =
{ [
(ItemSortBy.IsFolder, SortOrder.Ascending), (ItemSortBy.IsFolder, SortOrder.Ascending),
(ItemSortBy.SortName, SortOrder.Ascending) (ItemSortBy.SortName, SortOrder.Ascending)
}, ],
Limit = 1 Limit = 1
}); });
} }

View File

@ -1,7 +1,10 @@
#pragma warning disable CS1591 #pragma warning disable CS1591
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
@ -15,5 +18,13 @@ namespace Emby.Server.Implementations.Images
: base(fileSystem, providerManager, applicationPaths, imageProcessor, libraryManager) : base(fileSystem, providerManager, applicationPaths, imageProcessor, libraryManager)
{ {
} }
protected override IReadOnlyList<BaseItem> GetItemsWithImages(BaseItem item)
{
var items = base.GetItemsWithImages(item);
// Ignore any folders because they can have generated collages
return items.Where(i => i is not Folder).ToList();
}
} }
} }

View File

@ -169,8 +169,7 @@ namespace MediaBrowser.Controller.Entities.Audio
var childUpdateType = ItemUpdateType.None; var childUpdateType = ItemUpdateType.None;
// Refresh songs only and not m3u files in album folder foreach (var item in items)
foreach (var item in items.OfType<Audio>())
{ {
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();

View File

@ -8,7 +8,6 @@ using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Jellyfin.Data.Enums;
using Jellyfin.Extensions; using Jellyfin.Extensions;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;

View File

@ -54,7 +54,7 @@ namespace MediaBrowser.Providers.Playlists
item.LinkedChildren = items; item.LinkedChildren = items;
return Task.FromResult(ItemUpdateType.None); return Task.FromResult(ItemUpdateType.MetadataImport);
} }
private IEnumerable<LinkedChild> GetItems(string path, string extension) private IEnumerable<LinkedChild> GetItems(string path, string extension)