mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-25 13:48:49 +08:00
make history path configurable instead of hard-coded
This commit is contained in:
parent
db80ab25c7
commit
1689a6208b
@ -626,7 +626,7 @@ func ytdl(url string, selPlaylist *tview.TreeNode) error {
|
||||
playlistPath := path.Join(expandTilde(dir), selPlaylistName)
|
||||
audioPath := extractFilePath(stdout.Bytes(), playlistPath)
|
||||
|
||||
err = appendFile(expandTilde("~/.local/share/gomu/urls"), url+"\n")
|
||||
err = appendFile(expandTilde(viper.GetString("general.history_path")), url+"\n")
|
||||
if err != nil {
|
||||
return tracerr.Wrap(err)
|
||||
}
|
||||
|
8
start.go
8
start.go
@ -29,8 +29,9 @@ type Panel interface {
|
||||
}
|
||||
|
||||
const (
|
||||
CONFIG_PATH = ".config/gomu/config"
|
||||
MUSIC_PATH = "~/music"
|
||||
CONFIG_PATH = ".config/gomu/config"
|
||||
HISTORY_PATH = "~/.local/share/gomu/urls"
|
||||
MUSIC_PATH = "~/music"
|
||||
)
|
||||
|
||||
// Reads config file and sets the options
|
||||
@ -44,6 +45,8 @@ general:
|
||||
load_prev_queue: true
|
||||
# change this to directory that contains mp3 files
|
||||
music_dir: ~/music
|
||||
# url history of downloaded audio will be saved here
|
||||
history_path: ~/.local/share/gomu/urls
|
||||
popup_timeout: 5s
|
||||
# initial volume when gomu starts up
|
||||
volume: 100
|
||||
@ -99,6 +102,7 @@ emoji:
|
||||
|
||||
// General config
|
||||
viper.SetDefault("general.music_dir", MUSIC_PATH)
|
||||
viper.SetDefault("general.history_path", HISTORY_PATH)
|
||||
viper.SetDefault("general.confirm_on_exit", true)
|
||||
viper.SetDefault("general.confirm_bulk_add", true)
|
||||
viper.SetDefault("general.popup_timeout", "5s")
|
||||
|
Loading…
x
Reference in New Issue
Block a user