File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,14 +66,24 @@ def __init__(self,
6666 # Downloads go to <data_home> or $GPODDER_DOWNLOAD_DIR
6767 self .downloads = os .environ .get ('GPODDER_DOWNLOAD_DIR' , os .path .join (self .data_home ))
6868
69+ # Read config and change default directories where needed
70+ self .config = config_class (config_file )
71+
72+ if self .config .fs .downloads != '' :
73+ self .downloads = self .config .fs .downloads
74+
6975 # Initialize the gPodder home directories
7076 util .make_directory (self .data_home )
7177 util .make_directory (self .config_home )
7278
79+ if self .data_home != self .downloads :
80+ if not util .make_directory (self .downloads ):
81+ self .logger .warn ('Custom downloads path [%s] not writable reverting to default' , self .downloads )
82+ self .downloads = os .environ .get ('GPODDER_DOWNLOAD_DIR' , os .path .join (self .data_home ))
83+
7384 # Open the database and configuration file
7485 self .db = database_class (database_file , verbose )
7586 self .model = model_class (self )
76- self .config = config_class (config_file )
7787
7888 # Load installed/configured plugins
7989 self ._load_plugins ()
You can’t perform that action at this time.
0 commit comments