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:
@@ -126,9 +126,9 @@ func handleUploadGame(w http.ResponseWriter, r *http.Request) {
|
||||
[]byte(fmt.Sprintf(dosboxConfTemplate, relExe)), 0644)
|
||||
bundleFile = ".jsdos/dosbox.conf"
|
||||
} else {
|
||||
// Create .jsdos ZIP bundle
|
||||
// Create .jsdos ZIP bundle flat in data/games/
|
||||
bundleFile = gameID + ".jsdos"
|
||||
bundlePath := filepath.Join(gameDirPath, bundleFile)
|
||||
bundlePath := filepath.Join(filepath.Dir(gameDirPath), bundleFile)
|
||||
if err := createJSDOSBundle(extractDir, mainExe, bundlePath); err != nil {
|
||||
http.Error(w, "Failed to create bundle: "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user