Fix Peertube local timelines

This commit is contained in:
Thomas 2024-01-19 16:01:19 +01:00
parent 5692573d9c
commit fec7039fbe
2 changed files with 16 additions and 24 deletions

View file

@ -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,

View file

@ -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 {