From f2ebc5659eed25bb1b6874dc22c538140ee8e22f Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 29 Nov 2023 01:57:55 +0100 Subject: [PATCH] Only list collections if more than 1 item is contained --- .../Controllers/Repositories/LibraryItemRepository.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/back/src/Kyoo.Core/Controllers/Repositories/LibraryItemRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/LibraryItemRepository.cs index 78fcf60a..0a438961 100644 --- a/back/src/Kyoo.Core/Controllers/Repositories/LibraryItemRepository.cs +++ b/back/src/Kyoo.Core/Controllers/Repositories/LibraryItemRepository.cs @@ -48,9 +48,14 @@ namespace Kyoo.Core.Controllers movies) as m on false full outer join( select - * -- Collection + c.* -- Collection as c from - collections) as c on false + collections as c + left join link_collection_show as ls on ls.collection_id = c.id + left join link_collection_movie as lm on lm.collection_id = c.id + group by c.id + having count(*) > 1 + ) as c on false """; protected override Dictionary Config => new()