working album navigation and duplicate checks on backend

This commit is contained in:
wisplite
2025-11-22 23:18:53 -06:00
parent 8035be9a60
commit d9bad97a53
9 changed files with 146 additions and 19 deletions
+15
View File
@@ -51,4 +51,19 @@ func RegisterAlbumRoutes(rg *gin.RouterGroup) {
}
c.JSON(http.StatusOK, result)
})
album.POST("/getIDFromPath", func(c *gin.Context) {
var request struct {
Path string `json:"path"`
}
if err := c.ShouldBindJSON(&request); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
id, err := services.GetIDFromPath(request.Path)
if err != nil {
c.JSON(http.StatusNotFound, gin.H{"error": "Album not found"})
return
}
c.JSON(http.StatusOK, gin.H{"id": id})
})
}