From f6b3109a098558b5e229631feaeef2b1896e480e Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 27 Jun 2020 15:08:36 +0100 Subject: [PATCH] Remove the last of the {stations,systems}.p code from EDDB plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is one tiny regression for a very, very corner case. In 3.46 if you use EDDB as the 'Station' provider and: 1. Dock at Station A, in System X 2. Jump out to System Y, which is also populated 3. Exit out of the game 4. (Re-)Start EDMC 5. Hit 'Update' to manually trigger CAPI data retrieval you will see a "×" character as the Station Name, and can click on it to take you to the EDDB *System* page. It is only there because of EDMC using systems.p to check if System Y is populated. With this version in that circumstance there's no way to know that System Y is populated, so the code assumes not and doesn't show the "×", and thus there's nothing to click to go to the EDDB *System* page for System Y. But so long as the user is actually running the game and EDMC together then populated status is detected from Journal events and the "×" will be there whenever you're undocked but in a populated system. Caveat: We know Frontier have allowed some systems that are technically populated, but show a Population of zero. This code assumes that means they're *not* populated. --- plugins/eddb.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/plugins/eddb.py b/plugins/eddb.py index ecfaecfe..7b262cb7 100644 --- a/plugins/eddb.py +++ b/plugins/eddb.py @@ -41,19 +41,6 @@ def station_url(system_name, station_name): return system_url(system_name) -# system_name -> system_id or 0 -def system_id(system_name): - return this.system_ids.get(system_name, [0, False])[0] - -# system_name -> is_populated -def system_populated(system_name): - return this.system_ids.get(system_name, [0, False])[1] - -# (system_name, station_name) -> station_id or 0 -def station_id(system_name, station_name): - return this.station_ids.get((system_id(system_name), station_name), 0) - - def plugin_start3(plugin_dir): return 'eddb' @@ -92,5 +79,5 @@ def cmdr_data(data, is_beta): if config.get('station_provider') == 'eddb': this.station_marketid = data['commander']['docked'] and data['lastStarport']['id'] - this.station_link['text'] = data['commander']['docked'] and data['lastStarport']['name'] or (system_populated(data['lastSystem']['name']) and STATION_UNDOCKED or '') + this.station_link['text'] = data['commander']['docked'] and data['lastStarport']['name'] or (data['lastStarport']['name'] and data['lastStarport']['name'] != "" and STATION_UNDOCKED or '') this.station_link.update_idletasks()