aboutsummaryrefslogtreecommitdiffstats
path: root/internal/store/files.go
diff options
context:
space:
mode:
authorgrm <grm@eyesin.space>2026-09-18 14:35:59 +0300
committergrm <grm@eyesin.space>2026-09-18 14:36:17 +0300
commit7ac90f8e99dbf763b0fe04a17d7eef19dd22cae8 (patch)
treefa2409b9c201a27e19a64afcdd5057eeba0a61ac /internal/store/files.go
parent0fc470a8d588cac1a51cc4b3e1a2237dc56041c9 (diff)
downloadblogspace-7ac90f8e99dbf763b0fe04a17d7eef19dd22cae8.tar.gz
blogspace-7ac90f8e99dbf763b0fe04a17d7eef19dd22cae8.tar.bz2
blogspace-7ac90f8e99dbf763b0fe04a17d7eef19dd22cae8.zip
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'internal/store/files.go')
-rw-r--r--internal/store/files.go22
1 files changed, 0 insertions, 22 deletions
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))