#1 - Created request to check newest version of the app
All checks were successful
Build / build (push) Successful in 2m35s

#2 - Added request to download the newest version of the app
#3 - Added request to check progress during sync
#4 - Now blocking all request while sync is in progress
#5 - Implemented ants for thread pooling
#6 - Changed the sync request to now only start the sync
This commit is contained in:
2025-08-23 11:36:03 +02:00
parent 0d1c69d95e
commit 806e88adeb
26 changed files with 673 additions and 675 deletions

View File

@@ -0,0 +1,41 @@
package server
import (
"github.com/labstack/echo/v4"
"log"
"music-server/internal/backend"
"net/http"
)
type DownloadHandler struct {
}
func NewDownloadHandler() *DownloadHandler {
return &DownloadHandler{}
}
func (d *DownloadHandler) checkLatest(ctx echo.Context) error {
log.Println("Checking latest version")
latest := backend.CheckLatest()
return ctx.JSON(http.StatusOK, latest)
}
func (d *DownloadHandler) listAssetsOfLatest(ctx echo.Context) error {
log.Println("Listing assets")
assets := backend.ListAssetsOfLatest()
return ctx.JSON(http.StatusOK, assets)
}
func (d *DownloadHandler) downloadLatestWindows(ctx echo.Context) error {
log.Println("Downloading latest windows")
asset := backend.DownloadLatestWindows()
ctx.Response().Header().Set("Content-Type", "application/octet-stream")
return ctx.Redirect(http.StatusFound, asset)
}
func (d *DownloadHandler) downloadLatestLinux(ctx echo.Context) error {
log.Println("Downloading latest linux")
asset := backend.DownloadLatestLinux()
ctx.Response().Header().Set("Content-Type", "application/octet-stream")
return ctx.Redirect(http.StatusFound, asset)
}