diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-10 09:10:01 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-10 09:10:01 +0300 |
| commit | 93366c7a8603a64b410521dd19d967c0cd4d7e84 (patch) | |
| tree | d9d2439921d02c07aa12e72a790ef3273c3384a8 /docs/api.md | |
| parent | 297a2f4e2f0aba6f139736030a7845e0d91e5856 (diff) | |
internal/service: fix ListEpisodes global pagination by using cross-feed SQL query
Previously ListEpisodes requested per-feed episodes with the full limit
from every feed, concatenated them, and then sliced the resulting slice
in memory. This silently skipped episodes from deeper pages because the
per-feed DB limit never returned them.
Fix: Add a new repository method ListEpisodesByFeedIDsWithStatus that
takes a slice of feed IDs and applies LIMIT/OFFSET globally in a single
SQL query (IN (...)). The service builds the feed ID list and delegates
pagination to the database instead of emulating it in memory.
Files changed:
- internal/repository/podcast.go: add ListEpisodesByFeedIDsWithStatus
- internal/repository/podcast_repo.go: extend PodcastRepo interface
- internal/repository/mock.go: add mock implementation
- internal/service/podcast.go: replace per-feed loop with new method
- internal/service/podcast_test.go: add tests for ListEpisodes
- internal/repository/podcast_test.go: add integration tests for new repo method
- internal/api/handlers_test.go: add mockPingStore method
Diffstat (limited to 'docs/api.md')
0 files changed, 0 insertions, 0 deletions
