summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas <tschneider.ac@gmail.com>2024-01-19 16:01:19 +0100
committerThomas <tschneider.ac@gmail.com>2024-01-19 16:01:19 +0100
commitfec7039fbe9a40e552105b3c6fd7535290ba99cf (patch)
tree1203c08b76f2aec38f7b050836aae798c839fcac
parent5692573d9c8247bf2c83dc571b97e9f398e54294 (diff)
Fix Peertube local timelines
-rw-r--r--app/src/main/java/app/fedilab/android/peertube/client/PeertubeService.java2
-rw-r--r--app/src/main/java/app/fedilab/android/peertube/client/RetrofitPeertubeAPI.java38
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 50e81dc68..7134be103 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<String> languageOneOf);
//Local videos
- @GET("videos?sort=-publishedAt&filter=local")
+ @GET("videos?sort=-publishedAt&isLocal=true")
Call<VideoData> 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 049509a1c..0d4fae8a6 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<VideoData> videoCall = null;
ArrayList<String> 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 {