Fix Play button 404: bundle path and field name
- .jsdos bundles saved flat in data/games/ so /games/{id}.jsdos serves them
- bundleUrl() uses game.id (matches JSON) instead of game.slug (undefined)
- Delete handler also removes flat .jsdos bundle on game deletion
This commit is contained in:
@@ -187,11 +187,11 @@ func handleGameByID(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "Game not found", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
// Remove the entire game directory
|
||||
if err := os.RemoveAll(gameDir(g.ID)); err != nil {
|
||||
http.Error(w, "Failed to delete game", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
// Remove the game directory (game.json, cover, sockdrive files)
|
||||
os.RemoveAll(gameDir(g.ID))
|
||||
// Also remove the flat .jsdos bundle if it exists
|
||||
bundlePath := filepath.Join(dataDir, "games", g.ID+".jsdos")
|
||||
os.Remove(bundlePath)
|
||||
writeJSON(w, http.StatusOK, map[string]string{"status": "deleted"})
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user