mirror of
https://github.com/R0m1k3/podcastic.git
synced 2026-10-21 14:08:03 +02:00
feat: implement podcastIndexService using iTunes API for search and trending podcasts
This commit is contained in:
1 parent
a993e2d658
commit
e01b661aa2
7 files changed
+425
-139
No files matched your search
@@ -59,14 +59,18 @@ export const podcastIndexService = {
|
||||
query: string,
|
||||
limit: number = 20,
|
||||
): Promise<SearchResult[]> => {
|
||||
const term = query.trim();
|
||||
if (!term) return [];
|
||||
|
||||
const response = await axios.get<ItunesSearchResponse>(
|
||||
'https://itunes.apple.com/search',
|
||||
{
|
||||
params: {
|
||||
term: query,
|
||||
term,
|
||||
media: 'podcast',
|
||||
entity: 'podcast',
|
||||
limit: Math.min(limit, 50),
|
||||
country: 'FR', // Prioritize French store
|
||||
limit: Math.max(limit, 50), // Get more results to find the best match
|
||||
},
|
||||
timeout: 10000,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user