From f4777685814c4a044498a6073b29db261f35f5ee Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Thu, 13 Feb 2025 10:34:18 +0100 Subject: [PATCH] dsc ls marketplace stats with p key, not return since return is also "on_data_table_row_selected" event that also activates when mouse-clicking the the table. This was annoyoing since fetching those stats is from Discogs is really slow and the interface hung during that time! --- discodos/ctrl/tui.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/discodos/ctrl/tui.py b/discodos/ctrl/tui.py index b33c3a38..4cb1d6da 100644 --- a/discodos/ctrl/tui.py +++ b/discodos/ctrl/tui.py @@ -25,6 +25,7 @@ class DiscodosListApp(App, DiscogsMixin): # pylint: disable=too-many-instance-a ("e", "edit_sales_listing", "Edit sales listing"), ("v", "fetch_videos", "Fetch videos"), ("l", "fetch_listing_details", "Fetch listing details"), + ("p", "fetch_marketplace", "Fetch Marketplace stats"), ("r", "reimport_collection_item", "Reimport collection item"), ("f", "edit_folder", "Edit collection item folder"), Binding("escape", "back", "Back", tooltip="Cancel edits", show=True), @@ -369,9 +370,9 @@ def on_data_table_row_highlighted(self, event): ) ) - def on_data_table_row_selected(self, event): + def action_fetch_marketplace(self): """Fetch Discogs listing details and Marketplace stats for selected row.""" - row_key = event.row_key + row_key, _ = self.table.coordinate_to_cell_key(self.table.cursor_coordinate) release_id = self.table.get_cell(row_key, "discogs_id") # Stats stats, s_err, _ = self.fetch_marketplace_stats(release_id)