[2232] Set EDSM Settings

This commit is contained in:
David Sangrey committed 2024-05-12 23:18:24 -04:00
1 parent ad16f0666d
commit eece4c2ba7
1 file changed
+2 -2
+2 -2
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)