From f7eb829b5cef4de7c2066925f581bf6accbcd27e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 20 Dec 2022 15:29:33 +0100 Subject: [PATCH] Prevent displaying playlists without videos --- client/src/scss/classes.scss | 1 + server/lib/elastic-search/elastic-search-playlists.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/client/src/scss/classes.scss b/client/src/scss/classes.scss index b2f0cf3..66731ac 100644 --- a/client/src/scss/classes.scss +++ b/client/src/scss/classes.scss @@ -277,6 +277,7 @@ .button-link-container { text-align: left; + margin-top: 1.5rem; } } } diff --git a/server/lib/elastic-search/elastic-search-playlists.ts b/server/lib/elastic-search/elastic-search-playlists.ts index 2d78b25..4c450f1 100644 --- a/server/lib/elastic-search/elastic-search-playlists.ts +++ b/server/lib/elastic-search/elastic-search-playlists.ts @@ -34,6 +34,12 @@ async function queryPlaylists (search: PlaylistsSearchQuery) { }) } + mustNot.push({ + term: { + videosLength: 0 + } + }) + if (search.host) { filter.push({ term: {