1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-12 23:37:14 +03:00

[2232] Set EDSM Settings

This commit is contained in:
David Sangrey 2024-05-12 23:18:24 -04:00
parent ad16f0666d
commit eece4c2ba7
No known key found for this signature in database
GPG Key ID: 3AEADBB0186884BC

View File

@ -493,17 +493,17 @@ def credentials(cmdr: str) -> tuple[str, str] | None:
if not edsm_usernames: # https://github.com/EDCD/EDMarketConnector/issues/2232
edsm_usernames = ["" for _ in range(len(cmdrs))]
config.set('edsm_usernames', edsm_usernames)
else: # Check for Mismatched Length - fill with null values.
if len(edsm_usernames) < len(cmdrs):
edsm_usernames.extend(["" for _ in range(len(cmdrs) - len(edsm_usernames))])
config.set('edsm_usernames', edsm_usernames)
if not edsm_apikeys:
edsm_apikeys = ["" for _ in range(len(cmdrs))]
config.set('edsm_apikeys', edsm_apikeys)
else: # Check for Mismatched Length - fill with null values.
if len(edsm_apikeys) < len(cmdrs):
edsm_apikeys.extend(["" for _ in range(len(cmdrs) - len(edsm_apikeys))])
config.set('edsm_apikeys', edsm_apikeys)
if cmdr in cmdrs and len(cmdrs) == len(edsm_usernames) == len(edsm_apikeys):
idx = cmdrs.index(cmdr)