From fec7039fbe9a40e552105b3c6fd7535290ba99cf Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 19 Jan 2024 16:01:19 +0100 Subject: [PATCH] Fix Peertube local timelines --- .../peertube/client/PeertubeService.java | 2 +- .../peertube/client/RetrofitPeertubeAPI.java | 38 ++++++++----------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/peertube/client/PeertubeService.java b/app/src/main/java/app/fedilab/android/peertube/client/PeertubeService.java index 50e81dc6..7134be10 100644 --- a/app/src/main/java/app/fedilab/android/peertube/client/PeertubeService.java +++ b/app/src/main/java/app/fedilab/android/peertube/client/PeertubeService.java @@ -242,7 +242,7 @@ public interface PeertubeService { @Query("languageOneOf") List languageOneOf); //Local videos - @GET("videos?sort=-publishedAt&filter=local") + @GET("videos?sort=-publishedAt&isLocal=true") Call getLocalVideos( @Header("Authorization") String credentials, @Query("start") String maxId, diff --git a/app/src/main/java/app/fedilab/android/peertube/client/RetrofitPeertubeAPI.java b/app/src/main/java/app/fedilab/android/peertube/client/RetrofitPeertubeAPI.java index 049509a1..0d4fae8a 100644 --- a/app/src/main/java/app/fedilab/android/peertube/client/RetrofitPeertubeAPI.java +++ b/app/src/main/java/app/fedilab/android/peertube/client/RetrofitPeertubeAPI.java @@ -516,34 +516,26 @@ public class RetrofitPeertubeAPI { Call videoCall = null; ArrayList filter = selection != null ? new ArrayList<>(selection) : null; switch (timelineType) { - case MY_VIDEOS: - videoCall = peertubeService.getMyVideos(getToken(), max_id, count); - break; - case ACCOUNT_VIDEOS: - videoCall = peertubeService.getVideosForAccount(forAccount, max_id, count, showNSFWVideos); - break; - case SUBSCRIBTIONS: + case MY_VIDEOS -> videoCall = peertubeService.getMyVideos(getToken(), max_id, count); + case ACCOUNT_VIDEOS -> + videoCall = peertubeService.getVideosForAccount(forAccount, max_id, count, showNSFWVideos); + case SUBSCRIBTIONS -> { if (forAccount == null) { videoCall = peertubeService.getSubscriptionVideos(getToken(), max_id, count, filter); } else { videoCall = peertubeService.getChannelVideos(forAccount, max_id, count, showNSFWVideos); } - break; - case MOST_LIKED: - videoCall = peertubeService.getMostLikedVideos(getToken(), max_id, count, showNSFWVideos, filter); - break; - case LOCAL: - videoCall = peertubeService.getLocalVideos(getToken(), max_id, count, showNSFWVideos, filter); - break; - case TRENDING: - videoCall = peertubeService.getTrendingVideos(getToken(), max_id, count, showNSFWVideos, filter); - break; - case HISTORY: - videoCall = peertubeService.getHistory(getToken(), max_id, count, showNSFWVideos, null, null); - break; - case RECENT: - videoCall = peertubeService.getRecentlyAddedVideos(getToken(), max_id, count, showNSFWVideos, filter); - break; + } + case MOST_LIKED -> + videoCall = peertubeService.getMostLikedVideos(getToken(), max_id, count, showNSFWVideos, filter); + case LOCAL -> + videoCall = peertubeService.getLocalVideos(getToken(), max_id, count, showNSFWVideos, filter); + case TRENDING -> + videoCall = peertubeService.getTrendingVideos(getToken(), max_id, count, showNSFWVideos, filter); + case HISTORY -> + videoCall = peertubeService.getHistory(getToken(), max_id, count, showNSFWVideos, null, null); + case RECENT -> + videoCall = peertubeService.getRecentlyAddedVideos(getToken(), max_id, count, showNSFWVideos, filter); } if (videoCall != null) { try {