diff --git a/lbrynet/conf.py b/lbrynet/conf.py index 7234bde3a..9a640788c 100644 --- a/lbrynet/conf.py +++ b/lbrynet/conf.py @@ -254,6 +254,7 @@ def get_data_dir(): data_dir = user_data_dir("LBRY") if not os.path.isdir(data_dir): os.mkdir(data_dir) + return data_dir def get_log_filename(): diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/lbrynet_daemon/Daemon.py index 0e4ee0eee..b07b22842 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/lbrynet_daemon/Daemon.py @@ -273,7 +273,7 @@ class Daemon(AuthJSONRPCServer): self.ui_version = None self.ip = None self.first_run = None - self.log_file = conf.get_log_file() + self.log_file = conf.get_log_filename() self.current_db_revision = 1 self.session = None self.first_run_after_update = False @@ -282,7 +282,7 @@ class Daemon(AuthJSONRPCServer): # TODO: this should probably be passed into the daemon, or # possibly have the entire log upload functionality taken out # of the daemon, but I don't want to deal with that now - self.log_uploader = log_support.LogUploader.load('lbrynet', conf.get_log_file()) + self.log_uploader = log_support.LogUploader.load('lbrynet', conf.get_log_filename()) self.analytics_manager = None self.lbryid = PENDING_LBRY_ID @@ -757,13 +757,13 @@ class Daemon(AuthJSONRPCServer): return d def _set_lbryid(self, lbryid): - if lbryid is PENDING_LBRY_ID: - return self._make_lbryid() + if lbryid is PENDING_LBRY_ID or lbryid is None: + return self._make_set_and_save_lbryid() else: log.info("LBRY ID: " + base58.b58encode(lbryid)) self.lbryid = lbryid - def _make_lbryid(self): + def _make_set_and_save_lbryid(self): self.lbryid = generate_id() log.info("Generated new LBRY ID: " + base58.b58encode(self.lbryid)) d = self.settings.save_lbryid(self.lbryid) diff --git a/lbrynet/lbrynet_daemon/DaemonControl.py b/lbrynet/lbrynet_daemon/DaemonControl.py index 694c55164..74fd6831f 100644 --- a/lbrynet/lbrynet_daemon/DaemonControl.py +++ b/lbrynet/lbrynet_daemon/DaemonControl.py @@ -69,7 +69,7 @@ def start(): args = parser.parse_args() utils.setup_certs_for_windows() - lbrynet_log = conf.get_log_file() + lbrynet_log = conf.get_log_filename() log_support.configure_logging(lbrynet_log, args.logtoconsole, args.verbose) to_pass = {} @@ -144,7 +144,7 @@ def start_server_and_listen(launchui, use_auth, **kwargs): lbrynet_server = server.Site(site_base) lbrynet_server.requestFactory = DaemonRequest try: - reactor.listenTCP(settings.API_PORT, lbrynet_server, interface=settings.API_INTERFACE) + reactor.listenTCP(settings.api_port, lbrynet_server, interface=settings.API_INTERFACE) except error.CannotListenError: log.info('Daemon already running, exiting app') sys.exit(1)