From 113b6c427c3972d12ae20d569cf3cac79007b791 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 26 Aug 2020 11:55:23 +0100 Subject: [PATCH] station providers: Ensure the 'early station' functionality for all * If you request docking successfully then show the station namd and have the link work. * This is then only undone if you: 1) Dock and undock 2) Supercruise away 3) Jump away It is *not* undone if you simply cancel the docking request. Tested only with same provider for system and station for each of the three, not the other 6 combinations. --- plugins/edsm.py | 7 +++++++ plugins/inara.py | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/plugins/edsm.py b/plugins/edsm.py index 90066ee4..1f25f76d 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -57,6 +57,9 @@ STATION_UNDOCKED: str = '×' # "Station" name to display when not docked = U+00 # Main window clicks def system_url(system_name): + if this.system_address: + return requests.utils.requote_uri(f'https://www.edsm.net/en/system?systemID64={this.system_address}') + if system_name: return requests.utils.requote_uri(f'https://www.edsm.net/en/system?systemName={system_name}') @@ -66,6 +69,10 @@ def station_url(system_name, station_name): if system_name and station_name: return requests.utils.requote_uri(f'https://www.edsm.net/en/system?systemName={system_name}&stationName={station_name}') + # monitor state might think these are gone, but we don't yet + if this.system and this.station: + return requests.utils.requote_uri(f'https://www.edsm.net/en/system?systemName={this.system}&stationName={this.station}') + if system_name: return requests.utils.requote_uri(f'https://www.edsm.net/en/system?systemName={system_name}&stationName=ALL') diff --git a/plugins/inara.py b/plugins/inara.py index 529596f9..df03207a 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -137,6 +137,10 @@ def station_url(system_name, station_name): if system_name and station_name: return requests.utils.requote_uri(f'https://inara.cz/galaxy-station/?search={system_name}%20[{station_name}]') + # monitor state might think these are gone, but we don't yet + if this.system and this.station: + return requests.utils.requote_uri(f'https://inara.cz/galaxy-station/?search={this.system}%20[{this.station}]') + if system_name: return system_url(system_name)