Use $HOME/Downloads as default download directory

TODO: Get the default directory properly with XDG
This commit is contained in:
Tulir Asokan
2020-04-08 15:49:42 +03:00
parent a6f6fb3ef2
commit 79b61b86c9
3 changed files with 16 additions and 6 deletions

View File

@ -78,16 +78,15 @@ type Config struct {
}
// NewConfig creates a config that loads data from the given directory.
func NewConfig(configDir, cacheDir string) *Config {
home, _ := os.UserHomeDir()
func NewConfig(configDir, cacheDir, downloadDir string) *Config {
return &Config{
Dir: configDir,
CacheDir: cacheDir,
DownloadDir: downloadDir,
HistoryPath: filepath.Join(cacheDir, "history.db"),
RoomListPath: filepath.Join(cacheDir, "rooms.gob.gz"),
StateDir: filepath.Join(cacheDir, "state"),
MediaDir: filepath.Join(cacheDir, "media"),
DownloadDir: home,
RoomCacheSize: 32,
RoomCacheAge: 1 * 60,