RSS feed returns all entries (unpaginated); db handles limit=0 as unlimited

This commit is contained in:
2026-07-06 11:57:44 +02:00
parent bef4f7ba1d
commit c25264c993
3 changed files with 28 additions and 7 deletions
@@ -26,8 +26,25 @@ public class FeedService {
public static final int PAGE_SIZE = 20;
public List<ReleaseGroup> getFeedEntries() {
return getFeedEntries(1).entries();
public List<ReleaseGroup> getAllFeedEntries() {
var artists = artistService.findAll();
if (artists.isEmpty()) return List.of();
var artistMbids = new ArrayList<String>();
for (var a : artists) {
if (cacheService.needsRefresh(a.mbid())) {
var types = getMonitoredTypes(a);
releaseGroupService.fetchAndCache(a.mbid(), a.name(), types);
}
artistMbids.add(a.mbid());
}
var allTypes = List.of("Album", "Single", "EP", "Broadcast", "Other");
var monitoredTypes = new ArrayList<String>();
for (var a : artists) {
monitoredTypes.addAll(getMonitoredTypes(a));
}
return db.getFeed(artistMbids, monitoredTypes.isEmpty() ? allTypes : monitoredTypes, 0, 0).entries();
}
public FeedResult getFeedEntries(int page) {