feat: implement podcast discovery with PodcastIndex API integration and Discover page

This commit is contained in:
Michael committed 2026-04-16 10:01:05 +02:00
1 parent d7f158a498
commit 9bb61cc8a7
10 files changed
+1254 -5

No files matched your search

+54
View File
@@ -0,0 +1,54 @@
import api from './api';
export interface DiscoveryPodcast {
id: string;
title: string;
rssUrl: string;
description: string;
author?: string;
imageUrl?: string;
language?: string;
episodeCount?: number;
}
export interface DiscoveryResponse {
source: 'podcastindex' | 'local';
podcasts: DiscoveryPodcast[];
count: number;
message?: string;
}
export const discoveryService = {
discoverPodcasts: async (
query: string,
limit: number = 20,
offset: number = 0
): Promise<DiscoveryResponse> => {
const response = await api.get('/podcasts/discover', {
params: { q: query, limit, offset },
});
return response.data;
},
getTrendingPodcasts: async (limit: number = 20): Promise<DiscoveryResponse> => {
const response = await api.get('/podcasts/trending', {
params: { limit },
});
return response.data;
},
subscribeFromDiscovery: async (
rssUrl: string,
metadata?: {
title?: string;
author?: string;
imageUrl?: string;
}
): Promise<{ message: string; podcast: any }> => {
const response = await api.post('/podcasts/subscribe-discovery', {
rssUrl,
...metadata,
});
return response.data;
},
};