allow playing mid with external player

This commit is contained in:
josc146
2023-12-12 22:13:09 +08:00
parent b14fbc29b7
commit 0c796c8cfc
11 changed files with 113 additions and 25 deletions

View File

@@ -14,6 +14,13 @@ import (
wruntime "github.com/wailsapp/wails/v2/pkg/runtime"
)
func (a *App) SaveFile(path string, savedContent []byte) error {
if err := os.WriteFile(a.exDir+path, savedContent, 0644); err != nil {
return err
}
return nil
}
func (a *App) SaveJson(fileName string, jsonData any) error {
text, err := json.MarshalIndent(jsonData, "", " ")
if err != nil {
@@ -195,3 +202,8 @@ func (a *App) OpenFileFolder(path string, relative bool) error {
}
return errors.New("unsupported OS")
}
func (a *App) StartFile(path string) error {
_, err := CmdHelper(path)
return err
}