summaryrefslogtreecommitdiff
path: root/web/js/api.js
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-07 00:35:07 +0300
committerPaul Buetow <paul@buetow.org>2026-05-07 00:35:07 +0300
commit1898db985f708f0ff54d04d2d77303c633bc1ba2 (patch)
treef608db9059478d72673149a30dd5bfb650b1e025 /web/js/api.js
parent9458bf6d9861a6e09c616c8d290cce56fc61ac9f (diff)
Fix podcast episode pagination arguments (p0)
Diffstat (limited to 'web/js/api.js')
-rw-r--r--web/js/api.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/web/js/api.js b/web/js/api.js
index deabf20..28954a1 100644
--- a/web/js/api.js
+++ b/web/js/api.js
@@ -86,7 +86,20 @@ export const API = {
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) => {
+ podcastEpisodes: (setId, pagination, legacyOffset) => {
+ let limit = 50;
+ let offset = 0;
+ if (typeof pagination === 'number') {
+ if (typeof legacyOffset === 'number') {
+ limit = pagination;
+ offset = legacyOffset;
+ } else {
+ offset = pagination;
+ }
+ } else if (pagination) {
+ limit = pagination.limit ?? limit;
+ offset = pagination.offset ?? offset;
+ }
const params = new URLSearchParams({ limit, offset });
return api(`/api/podcasts/${setId}/episodes?${params}`);
},