IDK man, changes I guess
This commit is contained in:
7
app.go
7
app.go
@@ -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()})
|
||||
|
||||
Reference in New Issue
Block a user