From 0a3f81e364ce8dd41ffa61f7edd31fac4e7efaaa Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 4 Jul 2016 20:02:38 -0400 Subject: [PATCH] fix download directory not existing problem --- lbrynet/lbrynet_daemon/LBRYDaemon.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lbrynet/lbrynet_daemon/LBRYDaemon.py b/lbrynet/lbrynet_daemon/LBRYDaemon.py index fe72f63b2..95c42b5e1 100644 --- a/lbrynet/lbrynet_daemon/LBRYDaemon.py +++ b/lbrynet/lbrynet_daemon/LBRYDaemon.py @@ -179,15 +179,13 @@ class LBRYDaemon(jsonrpc.JSONRPC): self.db_dir = user_data_dir("LBRY") else: 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") + try: + if not os.path.isdir(default_download_directory): + os.mkdir(default_download_directory) + except: + log.info("Couldn't make download directory, using home") + default_download_directory = os.path.expanduser("~") self.daemon_conf = os.path.join(self.db_dir, 'daemon_settings.json')