RSS feed returns all entries (unpaginated); db handles limit=0 as unlimited
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user