From 7ac90f8e99dbf763b0fe04a17d7eef19dd22cae8 Mon Sep 17 00:00:00 2001 From: grm Date: Fri, 18 Sep 2026 14:35:59 +0300 Subject: Revert "Special pages: a gallery page of the blog's images" This reverts commit 0fc470a. The feature was not wanted. Migration 00013 stays on disk because databases have already run it (goose refuses a missing applied migration); 00014 drops the column and table it added. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/store/files.go | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'internal/store/files.go') diff --git a/internal/store/files.go b/internal/store/files.go index a4a4fb3..287b4d7 100644 --- a/internal/store/files.go +++ b/internal/store/files.go @@ -79,28 +79,6 @@ func (bs *BlogStore) ListFiles(ctx context.Context, kind, q string, limit, offse return out, total, rows.Err() } -// GalleryImages lists the images a gallery page shows, newest first: every -// library image but the page's hidden ones and except (the theme's logo and -// favicon, which the caller knows). -func (bs *BlogStore) GalleryImages(ctx context.Context, pageID int64, except []uuid.UUID) ([]File, error) { - rows, err := bs.db.Query(ctx, `SELECT `+fileCols+` FROM files WHERE kind = 'image' AND id <> ALL($2) - AND NOT EXISTS (SELECT 1 FROM page_hidden_files h WHERE h.page_id=$1 AND h.file_id=files.id) - ORDER BY created_at DESC, id DESC`, pageID, except) - if err != nil { - return nil, err - } - defer rows.Close() - var out []File - for rows.Next() { - f, err := scanFile(rows) - if err != nil { - return nil, err - } - out = append(out, *f) - } - return out, rows.Err() -} - // FileMeta loads a file without its bytes. func (bs *BlogStore) FileMeta(ctx context.Context, id uuid.UUID) (*File, error) { return scanFile(bs.db.QueryRow(ctx, `SELECT `+fileCols+` FROM files WHERE id=$1`, id)) -- cgit v1.2.3