IDK man, changes I guess

This commit is contained in:
2026-11-06 17:57:01 +00:00
parent f6ac9c2f34
commit 8e9bc500fa
15 changed files with 785 additions and 61 deletions

7
app.go
View File

@@ -98,6 +98,7 @@ func (a *App) routes() {
m.HandleFunc("POST /api/dialog/save", a.handleDialogSave)
m.HandleFunc("POST /api/reveal", a.handleReveal)
m.HandleFunc("POST /api/probe", a.handleProbe)
m.HandleFunc("POST /api/captions", a.handleCaptions)
m.HandleFunc("GET /api/media/{id}", a.handleMedia)
m.HandleFunc("GET /api/thumb", a.handleThumb)
m.HandleFunc("GET /api/keyframes", a.handleKeyframes)
@@ -197,6 +198,7 @@ func (a *App) handleInfo(w http.ResponseWriter, r *http.Request) {
"nativeDialogs": nativeDialogs,
"codecs": a.tools.CodecList(),
"codecsReady": a.tools.EncodersReady(),
"captionsOK": a.tools.HasFilter("subtitles"),
"containers": containers,
"copyExts": copyExts,
"mediaExts": mediaExts,
@@ -281,7 +283,8 @@ func (a *App) handleSessionPut(w http.ResponseWriter, r *http.Request) {
func (a *App) handleDialogOpen(w http.ResponseWriter, r *http.Request) {
var req struct {
Dir string `json:"dir"`
Dir string `json:"dir"`
Kind string `json:"kind"` // a key of fileKinds
}
readJSON(r, &req)
if !nativeDialogs {
@@ -293,7 +296,7 @@ func (a *App) handleDialogOpen(w http.ResponseWriter, r *http.Request) {
return
}
defer a.dialogMu.Unlock()
paths, err := nativeOpenDialog("Add videos", req.Dir)
paths, err := nativeOpenDialog(fileKindOf(req.Kind), req.Dir)
if err != nil {
log.Printf("native open dialog failed: %v", err)
writeJSON(w, map[string]any{"supported": false, "error": err.Error()})