playlists now save to files, can be restored from files
This commit is contained in:
@@ -31,8 +31,39 @@ func (fe *FrontendUtil) DirectoryPicker() (string, error) {
|
||||
fe.ctx,
|
||||
runtime.OpenDialogOptions{})
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("could not open directory dialog\n%w", err)
|
||||
return "", fmt.Errorf(
|
||||
"could not open directory dialog\n%w", err,
|
||||
)
|
||||
}
|
||||
|
||||
return dir, nil
|
||||
}
|
||||
|
||||
// PlaylistFilePicker opens a file selection dialog filtered
|
||||
// to M3U/M3U8 playlist files.
|
||||
func (fe *FrontendUtil) PlaylistFilePicker() (
|
||||
string,
|
||||
error,
|
||||
) {
|
||||
runtime.LogInfo(fe.ctx, "selecting a playlist file")
|
||||
|
||||
file, err := runtime.OpenFileDialog(
|
||||
fe.ctx,
|
||||
runtime.OpenDialogOptions{
|
||||
Title: "Import Playlist",
|
||||
Filters: []runtime.FileFilter{
|
||||
{
|
||||
DisplayName: "Playlist Files (*.m3u, *.m3u8)",
|
||||
Pattern: "*.m3u;*.m3u8",
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf(
|
||||
"could not open file dialog: %w", err,
|
||||
)
|
||||
}
|
||||
|
||||
return file, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user