diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-05 11:13:17 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-05 11:13:17 +0300 |
| commit | a78d332080c77a5dd0d8e20cd59ec4561c2b0dda (patch) | |
| tree | 922a22306d315ed1dc0155401373a368d836c618 /web/js/api.js | |
| parent | 48b02fbed5d519ca293537cd779127fec50735ce (diff) | |
Add frontend podcast support: API wrappers, episode cards, feed manager modal
Diffstat (limited to 'web/js/api.js')
| -rw-r--r-- | web/js/api.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/web/js/api.js b/web/js/api.js index 3d2586b..deabf20 100644 --- a/web/js/api.js +++ b/web/js/api.js @@ -85,4 +85,12 @@ export const API = { setPermissions: (body) => api('/api/admin/permissions', { method: 'POST', body }), delPermissions: (body) => api('/api/admin/permissions', { method: 'DELETE', body }), rescan: () => api('/api/admin/rescan', { method: 'POST' }), + podcasts: () => api('/api/podcasts'), + podcastEpisodes: (setId, limit = 50, offset = 0) => { + const params = new URLSearchParams({ limit, offset }); + return api(`/api/podcasts/${setId}/episodes?${params}`); + }, + subscribePodcast: (feedUrl, setName) => api('/api/podcasts', { method: 'POST', body: { feed_url: feedUrl, set_name: setName } }), + downloadEpisode: (episodeId) => api(`/api/podcasts/episodes/${episodeId}/download`, { method: 'POST' }), + toggleEpisodeComplete: (episodeId) => api(`/api/podcasts/episodes/${episodeId}/complete`, { method: 'POST' }), }; |
