fix url api image/audio

This commit is contained in:
2025-05-21 16:43:51 +02:00
parent 6e4f03aef8
commit b9e865780a
2 changed files with 3 additions and 3 deletions

View File

@@ -330,7 +330,7 @@ func getBeatmapCount(db *sql.DB) int {
}
func getRecent(db *sql.DB, limit, offset int) ([]Song, error) {
rows, err := db.Query("SELECT BeatmapId, MD5Hash, Title, Artist, Creator, Folder, File, Audio, TotalTime FROM Beatmap ORDER BY LastModifiedTime DESC LIMIT ? OFFSET ?", limit, offset)
rows, err := db.Query("SELECT BeatmapId, MD5Hash, Title, Artist, Creator, Folder, File, Audio, TotalTime FROM Beatmap GROUP BY Folder ORDER BY LastModifiedTime DESC LIMIT ? OFFSET ?", limit, offset)
if err != nil {
return []Song{}, err
}

View File

@@ -193,8 +193,8 @@ func runGrpcAndGateway(s *Server, port string) error {
mux := &http.ServeMux{}
mux.HandleFunc("/callback/", s.callback)
mux.HandleFunc("api/v1/audio/{filepath}", s.songFile)
mux.HandleFunc("api/v1/image/{filepath}", s.imageFile)
mux.HandleFunc("/api/v1/audio/{filepath}", s.songFile)
mux.HandleFunc("/api/v1/image/{filepath}", s.imageFile)
fileServer := http.FileServer(http.Dir("gen/swagger"))
mux.Handle("/swagger/", http.StripPrefix("/swagger/", fileServer))