fix(search): revert QUERY variable to use placeholder for dynamic input

This commit is contained in:
Benexl
2025-07-28 14:36:48 +03:00
parent adf75f65b2
commit d8804c711e
2 changed files with 4 additions and 4 deletions

View File

@@ -191,13 +191,13 @@ try:
year = media.get('startDate', {}).get('year', 'Unknown') if media.get('startDate') else 'Unknown'
status = media.get('status', 'Unknown')
genres = ', '.join(media.get('genres', [])[:3]) or 'Unknown'
display_format = f'{english_title} ({year}) [{status}] - {genres}'
# Debug output for matching
print(f"DEBUG: selected_item='{selected_item.strip()}' display_format='{display_format.strip()}'", file=sys.stderr)
if selected_item.strip() == display_format.strip():
json.dump(media, sys.stdout, indent=2)
sys.exit(0)
print(f"DEBUG: No match found for selected_item='{selected_item.strip()}'", file=sys.stderr)
sys.exit(1)
except Exception as e:
print(f'Error: {e}', file=sys.stderr)

View File

@@ -12,7 +12,7 @@ SEARCH_RESULTS_FILE="{SEARCH_RESULTS_FILE}"
AUTH_HEADER="{AUTH_HEADER}"
# Get the current query from fzf
QUERY="$1"
QUERY="{{q}}"
# If query is empty, exit with empty results
if [ -z "$QUERY" ]; then