Skip to content

Commit

Permalink
Merge pull request #106 from Bishoy-at-pieces/main
Browse files Browse the repository at this point in the history
fix search issue
  • Loading branch information
Bishoy-at-pieces committed May 10, 2024
2 parents 8a96918 + 3b6598c commit 4d3c222
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/pieces/commands/search_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@


def search(query, **kwargs):
global asset_ids

search_type = kwargs.get('search_type', 'assets')

# Join the list of strings into a single search phrase
Expand Down Expand Up @@ -44,10 +42,9 @@ def search(query, **kwargs):

# Combine and store best and suggested matches in asset_ids
combined_ids = exact_ids + suggested_ids
asset_ids = {index + 1: asset_id for index, asset_id in enumerate(combined_ids)}

# Prepare the combined list of names for printing
combined_details = [(asset_id, AssetsCommandsApi.get_asset_by_id(asset_id)) for asset_id in combined_ids]
combined_details = [(asset_id, AssetsCommandsApi.get_asset_snapshot(asset_id).name) for asset_id in combined_ids]

# Print the combined asset details
if combined_details:
Expand Down

0 comments on commit 4d3c222

Please sign in to comment.