mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2025-04-29 08:20:30 +05:30
Simplify comparators (#181)
This commit is contained in:
parent
3748afdd72
commit
8ba39000b1
@ -11,7 +11,7 @@ import java.io.IOException;
|
||||
|
||||
public class LbryHelper {
|
||||
|
||||
public static String getLBRYId(String videoId) throws IOException, InterruptedException {
|
||||
public static String getLBRYId(String videoId) throws IOException {
|
||||
return new JSONObject(
|
||||
RequestUtils.sendGet("https://api.lbry.com/yt/resolve?video_ids=" + URLUtils.silentEncode(videoId))
|
||||
).getJSONObject("data").getJSONObject("videos").optString(videoId, null);
|
||||
|
@ -727,7 +727,7 @@ public class ResponseHelper {
|
||||
|
||||
});
|
||||
|
||||
feedItems.sort((a, b) -> (int) (b.uploaded - a.uploaded));
|
||||
feedItems.sort(Comparator.comparing(o -> ((FeedItem) o).uploaded).reversed());
|
||||
|
||||
s.close();
|
||||
|
||||
@ -764,7 +764,7 @@ public class ResponseHelper {
|
||||
.setParameter("user", user.getId()).addEntity("Video", Video.class)
|
||||
.addEntity("Channel", me.kavin.piped.utils.obj.db.Channel.class).getResultList();
|
||||
|
||||
queryResults.sort((a, b) -> (int) (((Video) b[0]).getUploaded() - ((Video) a[0]).getUploaded()));
|
||||
queryResults.sort(Comparator.comparing(o -> ((Video) (((Object[]) o)[0])).getUploaded()).reversed());
|
||||
|
||||
final List<SyndEntry> entries = new ObjectArrayList<>();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user