mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-08-20 09:26:23 -07:00
Execute board creation SQL before creating dir, resolves issue #27
This commit is contained in:
parent
8840693a8b
commit
60fd5451bf
1 changed files with 10 additions and 9 deletions
|
@ -313,6 +313,16 @@ func buildBoard(board *gcsql.Board, newBoard, force bool) error {
|
|||
return ErrNoBoardTitle
|
||||
}
|
||||
|
||||
if newBoard {
|
||||
board.CreatedOn = time.Now()
|
||||
err := gcsql.CreateBoard(board)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err = board.UpdateID(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
dirPath := board.AbsolutePath()
|
||||
resPath := board.AbsolutePath("res")
|
||||
srcPath := board.AbsolutePath("src")
|
||||
|
@ -378,15 +388,6 @@ func buildBoard(board *gcsql.Board, newBoard, force bool) error {
|
|||
genericErrStr, thumbPath, err.Error()))
|
||||
}
|
||||
|
||||
if newBoard {
|
||||
board.CreatedOn = time.Now()
|
||||
err := gcsql.CreateBoard(board)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err = board.UpdateID(); err != nil {
|
||||
return err
|
||||
}
|
||||
BuildBoardPages(board)
|
||||
BuildThreads(true, board.ID, 0)
|
||||
gcsql.ResetBoardSectionArrays()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue