From e649a16620e3a9e18d63e7749c42f82679dc9c3b Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Thu, 16 Apr 2026 21:06:54 +0200 Subject: [PATCH] feat: improve search UX and backend inclusivity on AddPodcast page --- backend/src/services/podcastIndexService.ts | 1 - frontend/src/pages/AddPodcast.tsx | 32 ++++----------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/backend/src/services/podcastIndexService.ts b/backend/src/services/podcastIndexService.ts index 3b5f2db..91b0fa7 100644 --- a/backend/src/services/podcastIndexService.ts +++ b/backend/src/services/podcastIndexService.ts @@ -70,7 +70,6 @@ export const podcastIndexService = { media: 'podcast', entity: 'podcast', country: 'FR', - lang: 'fr_fr', // Force French localized search limit: 100, // Fetch more candidates to improve quality }, timeout: 10000, diff --git a/frontend/src/pages/AddPodcast.tsx b/frontend/src/pages/AddPodcast.tsx index 9c42ac3..7c9d766 100644 --- a/frontend/src/pages/AddPodcast.tsx +++ b/frontend/src/pages/AddPodcast.tsx @@ -11,7 +11,7 @@ import AlertModal, { AlertType } from '../components/AlertModal'; import { Search, Plus, Loader, Rss, Check, Globe, Sparkles, PlusCircle, LayoutGrid, ListMusic } from 'lucide-react'; import { authService } from '../services/authService'; import SuccessModal from '../components/SuccessModal'; -import { GENRES } from '../constants'; + export default function AddPodcast() { const queryClient = useQueryClient(); @@ -39,7 +39,7 @@ export default function AddPodcast() { const [rssSuccess, setRssSuccess] = useState(null); const [detailsEpisode, setDetailsEpisode] = useState(null); const [isDetailsOpen, setIsDetailsOpen] = useState(false); - const [selectedGenre, setSelectedGenre] = useState(GENRES[1].id); // Tech by default or first genre + const selectedGenre = ''; // Default to All categories // Modal state const [showSuccessModal, setShowSuccessModal] = useState(false); @@ -66,7 +66,7 @@ export default function AddPodcast() { const { data: searchResults, isLoading: isSearching } = useQuery({ queryKey: ['discover', 'search', searchQuery], queryFn: () => discoveryService.discoverPodcasts(searchQuery, 30), - enabled: searchQuery.length > 2 && searchType === 'podcasts', + enabled: searchQuery.length >= 2 && searchType === 'podcasts', staleTime: 5 * 60 * 1000, }); @@ -74,7 +74,7 @@ export default function AddPodcast() { const { data: episodeResults, isLoading: isSearchingEpisodes } = useQuery({ queryKey: ['episodes', 'search', searchQuery], queryFn: () => episodeService.searchEpisodes(searchQuery, 40), - enabled: searchQuery.length > 2 && searchType === 'episodes', + enabled: searchQuery.length >= 2 && searchType === 'episodes', staleTime: 2 * 60 * 1000, }); @@ -218,7 +218,7 @@ export default function AddPodcast() {
setSearchQuery(e.target.value)} className="input-premium !py-6 !pl-16 text-xl shadow-2xl transition-all group-hover:bg-[var(--bg-secondary)]" @@ -226,27 +226,7 @@ export default function AddPodcast() {
- {/* Category Discovery Pills */} - {searchType === 'podcasts' && ( -
- {GENRES.map(genre => ( - - ))} -
- )} + {/* Dynamic Results Grid */}