From 263bbf897ac9699b9bd27e9c7aba812111d08d42 Mon Sep 17 00:00:00 2001 From: "Petrus.Z" Date: Thu, 18 Nov 2021 15:34:35 +0800 Subject: [PATCH] Reduce one query Signed-off-by: Petrus.Z --- .../Library/Validators/CollectionPostScanTask.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs b/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs index c5ce4f1a87..1ca76ad952 100644 --- a/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs +++ b/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs @@ -79,12 +79,6 @@ namespace Emby.Server.Implementations.Library.Validators Limit = pagesize, Recursive = true }); - startIndex += pagesize; - - if (!movies.Any()) - { - break; - } foreach (var m in movies) { @@ -100,6 +94,13 @@ namespace Emby.Server.Implementations.Library.Validators } } } + + if (movies.Count < pagesize) + { + break; + } + + startIndex += pagesize; } }