Added fuzzy finder to search, made sync check as middleware, .id file is never used
Build / build (push) Successful in 45s

This commit is contained in:
2026-07-02 09:30:24 +02:00
parent a8df738108
commit eda60e0c07
9 changed files with 522 additions and 282 deletions
+22
View File
@@ -0,0 +1,22 @@
package middleware
import (
"music-server/internal/backend"
"music-server/internal/logging"
"net/http"
"github.com/labstack/echo/v5"
)
// SyncCheckMiddleware blocks requests when syncing is in progress.
// It returns HTTP 423 Locked with a standard message.
// This middleware should be applied to handlers that cannot execute during sync.
func SyncCheckMiddleware(next echo.HandlerFunc) echo.HandlerFunc {
return func(c *echo.Context) error {
if backend.Syncing {
logging.GetLogger().Info("Syncing is in progress - request blocked")
return c.JSON(http.StatusLocked, "Syncing is in progress")
}
return next(c)
}
}