From e35dce530a51cacf0ed22d1e3c01088425b9da65 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Mon, 4 Jul 2016 17:46:26 -0400 Subject: [PATCH] Set default download dir to ~/Downloads on Linux --- lbrynet/lbrynet_daemon/LBRYDaemon.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lbrynet/lbrynet_daemon/LBRYDaemon.py b/lbrynet/lbrynet_daemon/LBRYDaemon.py index 826857469d..90575f328c 100644 --- a/lbrynet/lbrynet_daemon/LBRYDaemon.py +++ b/lbrynet/lbrynet_daemon/LBRYDaemon.py @@ -178,7 +178,15 @@ def __init__(self, root, wallet_type="lbrycrd"): default_download_directory = os.path.join(os.path.expanduser("~"), 'Downloads') self.db_dir = user_data_dir("LBRY") else: - default_download_directory = os.getcwd() + default_download_directory = os.path.join(os.path.expanduser("~"), 'Downloads') + + if os.exists(default_download_directory): + if os.isfile(default_download_directory): + # Weird, ~/Downloads is a file, not a directory. Revert to just the home dir. + default_download_directory = os.path.expanduser("~") + else: + os.makedirs(default_download_directory) + self.db_dir = os.path.join(os.path.expanduser("~"), ".lbrynet") self.daemon_conf = os.path.join(self.db_dir, 'daemon_settings.json')