From e7ddcf1418e3ddea47f154796e2619d1edee7e98 Mon Sep 17 00:00:00 2001 From: Eggbertx Date: Sun, 20 Oct 2024 01:13:23 -0700 Subject: [PATCH] Remove old pre-view column reference and comment unused function --- pkg/building/posts.go | 6 +++--- pkg/building/threads.go | 1 - pkg/gcsql/posts.go | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/building/posts.go b/pkg/building/posts.go index c3bd57fd..ad66cabf 100644 --- a/pkg/building/posts.go +++ b/pkg/building/posts.go @@ -151,7 +151,7 @@ func QueryPosts(query string, params []any, cb func(*Post) error) error { return rows.Close() } -func GetBuildablePost(id int, _ int) (*Post, error) { +/* func GetBuildablePost(id int, _ int) (*Post, error) { const query = "SELECT * FROM DBPREFIXv_building_posts WHERE DBPREFIXposts.id = ?" var post Post @@ -183,10 +183,10 @@ func GetBuildablePost(id int, _ int) (*Post, error) { post.IsTopPost = post.ParentID == 0 post.Extension = path.Ext(post.Filename) return &post, nil -} +} */ func GetBuildablePostsByIP(ip string, limit int) ([]*Post, error) { - query := "SELECT * FROM DBPREFIXv_building_posts WHERE ip = PARAM_ATON ORDER BY DBPREFIXposts.id DESC" + query := "SELECT * FROM DBPREFIXv_building_posts WHERE ip = PARAM_ATON ORDER BY id DESC" if limit > 0 { query += " LIMIT " + strconv.Itoa(limit) } diff --git a/pkg/building/threads.go b/pkg/building/threads.go index a7bfd292..f1d6d9c9 100644 --- a/pkg/building/threads.go +++ b/pkg/building/threads.go @@ -91,7 +91,6 @@ func BuildThreadPages(op *gcsql.Post) error { errEv.Err(err).Caller().Send() return fmt.Errorf("unable to set file permissions for /%s/res/%d.html: %s", board.Dir, op.ID, err.Error()) } - fmt.Println(thread.ID, thread.BoardID) errEv.Int("op", posts[0].ID) // render thread page diff --git a/pkg/gcsql/posts.go b/pkg/gcsql/posts.go index 2c44cc70..cfa72aec 100644 --- a/pkg/gcsql/posts.go +++ b/pkg/gcsql/posts.go @@ -91,7 +91,7 @@ func GetPostsFromIP(ip string, limit int, onlyNotDeleted bool) ([]Post, error) { // GetTopPostAndBoardDirFromPostID returns the ID of the top post and the board dir in postID's thread func GetTopPostAndBoardDirFromPostID(postID int) (int, string, error) { - const query = "SELECT * FROM DBPREFIXv_top_post_board_dir WHERE p.id = ?" + const query = "SELECT * FROM DBPREFIXv_top_post_board_dir WHERE id = ?" var opID int var dir string err := QueryRowTimeoutSQL(nil, query, []any{postID}, []any{&opID, &dir})