diff --git a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/IDataSource.cs b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/IDataSource.cs index d4702cf7aa..941c7d0caa 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/DataSource/IDataSource.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/DataSource/IDataSource.cs @@ -9,12 +9,12 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource internal interface IDataSource { ContentNodeKit GetContentSource(IScope scope, int id); - IEnumerable GetAllContentSources(IScope scope); // must order by level + IEnumerable GetAllContentSources(IScope scope); // must order by level, sortOrder IEnumerable GetBranchContentSources(IScope scope, int id); // must order by level, sortOrder IEnumerable GetTypeContentSources(IScope scope, IEnumerable ids); ContentNodeKit GetMediaSource(IScope scope, int id); - IEnumerable GetAllMediaSources(IScope scope); // must order by level + IEnumerable GetAllMediaSources(IScope scope); // must order by level, sortOrder IEnumerable GetBranchMediaSources(IScope scope, int id); // must order by level, sortOrder IEnumerable GetTypeMediaSources(IScope scope, IEnumerable ids); } diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs index 5c6dc3d252..5a7ae9e899 100755 --- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedSnapshotService.cs @@ -349,10 +349,9 @@ namespace Umbraco.Web.PublishedCache.NuCache _localContentDb?.Clear(); - // IMPORTANT GetAllContentSources sorts kits by level - //TODO: We should sort by level + sort order and then we can use SetAllFastSorted + // IMPORTANT GetAllContentSources sorts kits by level + sortOrder var kits = _dataSource.GetAllContentSources(scope); - return _contentStore.SetAll(kits); + return _contentStore.SetAllFastSorted(kits); } } @@ -369,7 +368,7 @@ namespace Umbraco.Web.PublishedCache.NuCache var kits = _localContentDb.Select(x => x.Value) .OrderBy(x => x.Node.Level) - .ThenBy(x => x.Node.SortOrder); // IMPORTANT sort by level + order + .ThenBy(x => x.Node.SortOrder); // IMPORTANT sort by level + sortOrder return _contentStore.SetAllFastSorted(kits); } } @@ -425,10 +424,9 @@ namespace Umbraco.Web.PublishedCache.NuCache _localMediaDb?.Clear(); _logger.Debug("Loading media from database..."); - // IMPORTANT GetAllMediaSources sorts kits by level - //TODO: We should sort by level + sort order and then we can use SetAllFastSorted + // IMPORTANT GetAllMediaSources sorts kits by level + sortOrder var kits = _dataSource.GetAllMediaSources(scope); - return _mediaStore.SetAll(kits); + return _mediaStore.SetAllFastSorted(kits); } }