mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-07 11:17:25 +01:00
Fixed sort type cannot be changed for multireddit.
This commit is contained in:
parent
cc86e047f0
commit
cdd25f3405
@ -68,7 +68,11 @@ public class PostDataSource extends PageKeyedDataSource<String, Post> {
|
|||||||
if (postType == TYPE_SUBREDDIT) {
|
if (postType == TYPE_SUBREDDIT) {
|
||||||
this.subredditOrUserName = path;
|
this.subredditOrUserName = path;
|
||||||
} else {
|
} else {
|
||||||
multiRedditPath = path;
|
if (path.endsWith("/")) {
|
||||||
|
multiRedditPath = path + sortType.getType().value;
|
||||||
|
} else {
|
||||||
|
multiRedditPath = path + "/" + sortType.getType().value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
paginationNetworkStateLiveData = new MutableLiveData<>();
|
paginationNetworkStateLiveData = new MutableLiveData<>();
|
||||||
initialLoadStateLiveData = new MutableLiveData<>();
|
initialLoadStateLiveData = new MutableLiveData<>();
|
||||||
@ -747,17 +751,16 @@ public class PostDataSource extends PageKeyedDataSource<String, Post> {
|
|||||||
Call<String> getPost;
|
Call<String> getPost;
|
||||||
if (accessToken == null) {
|
if (accessToken == null) {
|
||||||
if (sortType.getTime() != null) {
|
if (sortType.getTime() != null) {
|
||||||
getPost = api.getMultiRedditPosts(multiRedditPath, lastItem, sortType.getType().value,
|
getPost = api.getMultiRedditPosts(multiRedditPath, lastItem, sortType.getTime().value);
|
||||||
sortType.getTime().value);
|
|
||||||
} else {
|
} else {
|
||||||
getPost = api.getMultiRedditPosts(multiRedditPath, lastItem, sortType.getType().value);
|
getPost = api.getMultiRedditPosts(multiRedditPath, lastItem);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (sortType.getTime() != null) {
|
if (sortType.getTime() != null) {
|
||||||
getPost = api.getMultiRedditPostsOauth(multiRedditPath, lastItem, sortType.getType().value,
|
getPost = api.getMultiRedditPostsOauth(multiRedditPath, lastItem,
|
||||||
sortType.getTime().value, RedditUtils.getOAuthHeader(accessToken));
|
sortType.getTime().value, RedditUtils.getOAuthHeader(accessToken));
|
||||||
} else {
|
} else {
|
||||||
getPost = api.getMultiRedditPostsOauth(multiRedditPath, lastItem, sortType.getType().value,
|
getPost = api.getMultiRedditPostsOauth(multiRedditPath, lastItem,
|
||||||
RedditUtils.getOAuthHeader(accessToken));
|
RedditUtils.getOAuthHeader(accessToken));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -817,17 +820,17 @@ public class PostDataSource extends PageKeyedDataSource<String, Post> {
|
|||||||
Call<String> getPost;
|
Call<String> getPost;
|
||||||
if (accessToken == null) {
|
if (accessToken == null) {
|
||||||
if (sortType.getTime() != null) {
|
if (sortType.getTime() != null) {
|
||||||
getPost = api.getMultiRedditPosts(multiRedditPath, after, sortType.getType().value,
|
getPost = api.getMultiRedditPosts(multiRedditPath, after,
|
||||||
sortType.getTime().value);
|
sortType.getTime().value);
|
||||||
} else {
|
} else {
|
||||||
getPost = api.getMultiRedditPosts(multiRedditPath, after, sortType.getType().value);
|
getPost = api.getMultiRedditPosts(multiRedditPath, after);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (sortType.getTime() != null) {
|
if (sortType.getTime() != null) {
|
||||||
getPost = api.getMultiRedditPostsOauth(multiRedditPath, after, sortType.getType().value,
|
getPost = api.getMultiRedditPostsOauth(multiRedditPath, after,
|
||||||
sortType.getTime().value, RedditUtils.getOAuthHeader(accessToken));
|
sortType.getTime().value, RedditUtils.getOAuthHeader(accessToken));
|
||||||
} else {
|
} else {
|
||||||
getPost = api.getMultiRedditPostsOauth(multiRedditPath, after, sortType.getType().value,
|
getPost = api.getMultiRedditPostsOauth(multiRedditPath, after,
|
||||||
RedditUtils.getOAuthHeader(accessToken));
|
RedditUtils.getOAuthHeader(accessToken));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -273,19 +273,19 @@ public interface RedditAPI {
|
|||||||
Call<String> getUserMultiReddits(@Path("username") String username);
|
Call<String> getUserMultiReddits(@Path("username") String username);
|
||||||
|
|
||||||
@GET("{multipath}?raw_json=1")
|
@GET("{multipath}?raw_json=1")
|
||||||
Call<String> getMultiRedditPosts(@Path(value = "multipath", encoded = true) String multiPath, @Query("after") String after,
|
Call<String> getMultiRedditPosts(@Path(value = "multipath", encoded = true) String multiPath,
|
||||||
@Query("sort") String sortType);
|
@Query("after") String after);
|
||||||
|
|
||||||
@GET("{multipath}?raw_json=1")
|
@GET("{multipath}?raw_json=1")
|
||||||
Call<String> getMultiRedditPosts(@Path(value = "multipath", encoded = true) String multiPath, @Query("after") String after,
|
Call<String> getMultiRedditPosts(@Path(value = "multipath", encoded = true) String multiPath,
|
||||||
@Query("sort") String sortType, @Query("t") String sortTime);
|
@Query("after") String after, @Query("t") String sortTime);
|
||||||
|
|
||||||
@GET("{multipath}.json?raw_json=1")
|
@GET("{multipath}.json?raw_json=1")
|
||||||
Call<String> getMultiRedditPostsOauth(@Path(value = "multipath", encoded = true) String multiPath, @Query("after") String after,
|
Call<String> getMultiRedditPostsOauth(@Path(value = "multipath", encoded = true) String multiPath,
|
||||||
@Query("sort") String sortType, @Query("t") String sortTime,
|
@Query("after") String after, @Query("t") String sortTime,
|
||||||
@HeaderMap Map<String, String> headers);
|
@HeaderMap Map<String, String> headers);
|
||||||
|
|
||||||
@GET("{multipath}.json?raw_json=1")
|
@GET("{multipath}.json?raw_json=1")
|
||||||
Call<String> getMultiRedditPostsOauth(@Path(value = "multipath", encoded = true) String multiPath, @Query("after") String after,
|
Call<String> getMultiRedditPostsOauth(@Path(value = "multipath", encoded = true) String multiPath,
|
||||||
@Query("sort") String sortType, @HeaderMap Map<String, String> headers);
|
@Query("after") String after, @HeaderMap Map<String, String> headers);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user