diff --git a/src/components/LiveSearch.tsx b/src/components/LiveSearch.tsx index bb47e776..69c4b1c5 100644 --- a/src/components/LiveSearch.tsx +++ b/src/components/LiveSearch.tsx @@ -1,10 +1,11 @@ import React, { useState, useEffect, useRef, useCallback } from 'react'; import { useNavigate } from 'react-router-dom'; import { Search, Disc3, Users, Music, SlidersVertical, TextSearch } from 'lucide-react'; -import { search, SearchResults, buildCoverArtUrl } from '../api/subsonic'; +import { search, SearchResults, buildCoverArtUrl, coverArtCacheKey } from '../api/subsonic'; import { usePlayerStore, songToTrack } from '../store/playerStore'; import { useAuthStore } from '../store/authStore'; import { useTranslation } from 'react-i18next'; +import CachedImage from './CachedImage'; function debounce(fn: (q: string) => void, ms: number): (q: string) => void { let timer: ReturnType; @@ -166,7 +167,12 @@ export default function LiveSearch() { onClick={() => { navigate(`/album/${a.id}`); setOpen(false); setQuery(''); }} role="option" aria-selected={activeIndex === i}> {a.coverArt ? ( - + ) : (
)} diff --git a/src/components/MobileSearchOverlay.tsx b/src/components/MobileSearchOverlay.tsx index df35e539..908e5cee 100644 --- a/src/components/MobileSearchOverlay.tsx +++ b/src/components/MobileSearchOverlay.tsx @@ -2,10 +2,11 @@ import React, { useState, useEffect, useRef, useCallback } from 'react'; import { createPortal } from 'react-dom'; import { useNavigate } from 'react-router-dom'; import { X, Search, Disc3, Users, Music, Music2, Clock, ChevronRight } from 'lucide-react'; -import { search, SearchResults, buildCoverArtUrl } from '../api/subsonic'; +import { search, SearchResults, buildCoverArtUrl, coverArtCacheKey } from '../api/subsonic'; import { usePlayerStore, songToTrack } from '../store/playerStore'; import { useAuthStore } from '../store/authStore'; import { useTranslation } from 'react-i18next'; +import CachedImage from './CachedImage'; const STORAGE_KEY = 'psysonic_recent_searches'; const MAX_RECENT = 6; @@ -203,7 +204,12 @@ export default function MobileSearchOverlay({ onClose }: { onClose: () => void } {results!.albums.map(a => (