Limit RSS feed size to 100 entries (#263)

This commit is contained in:
Kavin 2022-05-10 09:40:26 +01:00 committed by GitHub
parent ae9bd3b7be
commit ce70bd037b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -837,8 +837,6 @@ public class ResponseHelper {
video.getUploaded(), channel.isVerified())); video.getUploaded(), channel.isVerified()));
} }
feedItems.sort(Comparator.<StreamItem>comparingLong(o -> o.uploaded).reversed());
return Constants.mapper.writeValueAsBytes(feedItems); return Constants.mapper.writeValueAsBytes(feedItems);
} }
} }
@ -877,7 +875,7 @@ public class ResponseHelper {
)) ))
.orderBy(cb.desc(root.get("uploaded"))); .orderBy(cb.desc(root.get("uploaded")));
List<Video> videos = s.createQuery(criteria).list(); List<Video> videos = s.createQuery(criteria).setMaxResults(100).list();
final List<SyndEntry> entries = new ObjectArrayList<>(); final List<SyndEntry> entries = new ObjectArrayList<>();