Added a new sync that uses hash

Added a new sync that uses hash and sqlc for the queries. Added db
migration. Started adding a config file.
This commit is contained in:
2024-12-19 12:11:20 +01:00
parent 8fa93d580d
commit 5ab19e16e5
26 changed files with 1527 additions and 45 deletions

View File

@@ -1,9 +1,10 @@
package api
import (
"github.com/gin-gonic/gin"
"music-server/pkg/server"
"net/http"
"github.com/gin-gonic/gin"
)
type Sync struct {
@@ -25,6 +26,12 @@ func (s *Sync) SyncGamesQuick(ctx *gin.Context) {
ctx.JSON(http.StatusOK, "Games are synced")
}
func (s *Sync) SyncGamesNew(ctx *gin.Context) {
response := server.SyncGamesNew()
server.Reset()
ctx.JSON(http.StatusOK, response)
}
func (s *Sync) ResetGames(ctx *gin.Context) {
server.ResetDB()
ctx.JSON(http.StatusOK, "Games and songs are deleted from the database")