aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2020-04-08 15:30:29 +0300
committerTulir Asokan <tulir@maunium.net>2020-04-08 15:30:29 +0300
commita6f6fb3ef22658508671296a31367a198205da99 (patch)
tree448766b706b0dab25e6541fd1d9cb5e2a7439c51 /config
parent80564b2887085a088a4f753042dbe345092e45a1 (diff)
Display thumbnail for all files and add commands to download and open files
Diffstat (limited to 'config')
-rw-r--r--config/config.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go
index e8c7b1a..3507833 100644
--- a/config/config.go
+++ b/config/config.go
@@ -66,6 +66,7 @@ type Config struct {
HistoryPath string `yaml:"history_path"`
RoomListPath string `yaml:"room_list_path"`
MediaDir string `yaml:"media_dir"`
+ DownloadDir string `yaml:"download_dir"`
StateDir string `yaml:"state_dir"`
Preferences UserPreferences `yaml:"-"`
@@ -78,6 +79,7 @@ type Config struct {
// NewConfig creates a config that loads data from the given directory.
func NewConfig(configDir, cacheDir string) *Config {
+ home, _ := os.UserHomeDir()
return &Config{
Dir: configDir,
CacheDir: cacheDir,
@@ -85,6 +87,7 @@ func NewConfig(configDir, cacheDir string) *Config {
RoomListPath: filepath.Join(cacheDir, "rooms.gob.gz"),
StateDir: filepath.Join(cacheDir, "state"),
MediaDir: filepath.Join(cacheDir, "media"),
+ DownloadDir: home,
RoomCacheSize: 32,
RoomCacheAge: 1 * 60,