Skip to content

Commit

Permalink
dsc ls marketplace stats with p key, not return
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
JOJ0 committed Feb 13, 2025
1 parent 3d6d259 commit f477768
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions discodos/ctrl/tui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f477768

Please sign in to comment.