Skip to content

Commit

Permalink
Remove old pre-view column reference and comment unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
Eggbertx committed Oct 20, 2024
1 parent 658ee0f commit e7ddcf1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/building/posts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down
1 change: 0 additions & 1 deletion pkg/building/threads.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/gcsql/posts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit e7ddcf1

Please sign in to comment.