Display thumbnail for all files and add commands to download and open files

This commit is contained in:
Tulir Asokan
2020-04-08 15:30:29 +03:00
parent 80564b2887
commit a6f6fb3ef2
16 changed files with 224 additions and 100 deletions

View File

@ -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,