Fix Peertube local timelines

Media3
Thomas 10 months ago
parent 5692573d9c
commit fec7039fbe

@ -242,7 +242,7 @@ public interface PeertubeService {
@Query("languageOneOf") List<String> languageOneOf); @Query("languageOneOf") List<String> languageOneOf);
//Local videos //Local videos
@GET("videos?sort=-publishedAt&filter=local") @GET("videos?sort=-publishedAt&isLocal=true")
Call<VideoData> getLocalVideos( Call<VideoData> getLocalVideos(
@Header("Authorization") String credentials, @Header("Authorization") String credentials,
@Query("start") String maxId, @Query("start") String maxId,

@ -516,34 +516,26 @@ public class RetrofitPeertubeAPI {
Call<VideoData> videoCall = null; Call<VideoData> videoCall = null;
ArrayList<String> filter = selection != null ? new ArrayList<>(selection) : null; ArrayList<String> filter = selection != null ? new ArrayList<>(selection) : null;
switch (timelineType) { switch (timelineType) {
case MY_VIDEOS: case MY_VIDEOS -> videoCall = peertubeService.getMyVideos(getToken(), max_id, count);
videoCall = peertubeService.getMyVideos(getToken(), max_id, count); case ACCOUNT_VIDEOS ->
break; videoCall = peertubeService.getVideosForAccount(forAccount, max_id, count, showNSFWVideos);
case ACCOUNT_VIDEOS: case SUBSCRIBTIONS -> {
videoCall = peertubeService.getVideosForAccount(forAccount, max_id, count, showNSFWVideos);
break;
case SUBSCRIBTIONS:
if (forAccount == null) { if (forAccount == null) {
videoCall = peertubeService.getSubscriptionVideos(getToken(), max_id, count, filter); videoCall = peertubeService.getSubscriptionVideos(getToken(), max_id, count, filter);
} else { } else {
videoCall = peertubeService.getChannelVideos(forAccount, max_id, count, showNSFWVideos); videoCall = peertubeService.getChannelVideos(forAccount, max_id, count, showNSFWVideos);
} }
break; }
case MOST_LIKED: case MOST_LIKED ->
videoCall = peertubeService.getMostLikedVideos(getToken(), max_id, count, showNSFWVideos, filter); videoCall = peertubeService.getMostLikedVideos(getToken(), max_id, count, showNSFWVideos, filter);
break; case LOCAL ->
case LOCAL: videoCall = peertubeService.getLocalVideos(getToken(), max_id, count, showNSFWVideos, filter);
videoCall = peertubeService.getLocalVideos(getToken(), max_id, count, showNSFWVideos, filter); case TRENDING ->
break; videoCall = peertubeService.getTrendingVideos(getToken(), max_id, count, showNSFWVideos, filter);
case TRENDING: case HISTORY ->
videoCall = peertubeService.getTrendingVideos(getToken(), max_id, count, showNSFWVideos, filter); videoCall = peertubeService.getHistory(getToken(), max_id, count, showNSFWVideos, null, null);
break; case RECENT ->
case HISTORY: videoCall = peertubeService.getRecentlyAddedVideos(getToken(), max_id, count, showNSFWVideos, filter);
videoCall = peertubeService.getHistory(getToken(), max_id, count, showNSFWVideos, null, null);
break;
case RECENT:
videoCall = peertubeService.getRecentlyAddedVideos(getToken(), max_id, count, showNSFWVideos, filter);
break;
} }
if (videoCall != null) { if (videoCall != null) {
try { try {

Loading…
Cancel
Save