From a803c85984bc1d6951503c5b7561b02bcffeba65 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Mon, 18 Jul 2022 14:10:51 +0200 Subject: [PATCH] Fix pinned versions showing deleted versions --- .../hangar/db/dao/internal/versions/HangarVersionsDAO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/papermc/hangar/db/dao/internal/versions/HangarVersionsDAO.java b/src/main/java/io/papermc/hangar/db/dao/internal/versions/HangarVersionsDAO.java index a7fdb832..30075764 100644 --- a/src/main/java/io/papermc/hangar/db/dao/internal/versions/HangarVersionsDAO.java +++ b/src/main/java/io/papermc/hangar/db/dao/internal/versions/HangarVersionsDAO.java @@ -118,7 +118,7 @@ public interface HangarVersionsDAO { FROM pinned_versions pv JOIN project_versions p ON pv.version_id = p.id JOIN project_channels pc on pc.id = p.channel_id - WHERE pv.project_id = :projectId AND pv.type = 'version' LIMIT 5) + WHERE pv.project_id = :projectId AND pv.type = 'version' AND p.visibility = 0 LIMIT 5) UNION ALL (SELECT pv.version_id, pv."type", @@ -134,7 +134,7 @@ public interface HangarVersionsDAO { FROM pinned_versions pv JOIN project_versions p ON pv.version_id = p.id JOIN project_channels pc on pc.id = p.channel_id - WHERE pv.project_id = :projectId AND pv.type = 'channel' LIMIT 1) + WHERE pv.project_id = :projectId AND pv.type = 'channel' AND p.visibility = 0 LIMIT 1) """) @RegisterConstructorMapper(HangarProject.PinnedVersion.class) List getPinnedVersions(long projectId);