Claim has source #1188

Merged
kekkyojin merged 2 commits from claim-has-source into master 2021-05-10 17:13:28 +02:00
6 changed files with 27 additions and 11 deletions
Showing only changes of commit a878d3bdd4 - Show all commits

View file

@ -230,7 +230,8 @@ public class ChannelContentFragment extends Fragment implements DownloadActionLi
0, 0,
0, 0,
currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage, currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage,
Helper.CONTENT_PAGE_SIZE); Helper.CONTENT_PAGE_SIZE,
true);
} }
private List<String> getContentSortOrder() { private List<String> getContentSortOrder() {

View file

@ -421,7 +421,8 @@ public class AllContentFragment extends BaseFragment implements DownloadActionLi
0, 0,
0, 0,
currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage, currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage,
Helper.CONTENT_PAGE_SIZE); Helper.CONTENT_PAGE_SIZE,
true);
} }
private List<String> getContentSortOrder() { private List<String> getContentSortOrder() {

View file

@ -79,7 +79,8 @@ public class EditorsChoiceFragment extends BaseFragment {
Arrays.asList(Claim.ORDER_BY_RELEASE_TIME), Arrays.asList(Claim.ORDER_BY_RELEASE_TIME),
null, null,
1, 1,
99); 99,
true);
} }
public void onResume() { public void onResume() {

View file

@ -415,7 +415,8 @@ public class FollowingFragment extends BaseFragment implements
Arrays.asList(Claim.ORDER_BY_EFFECTIVE_AMOUNT), Arrays.asList(Claim.ORDER_BY_EFFECTIVE_AMOUNT),
null, null,
currentSuggestedPage == 0 ? 1 : currentSuggestedPage, currentSuggestedPage == 0 ? 1 : currentSuggestedPage,
SUGGESTED_PAGE_SIZE); SUGGESTED_PAGE_SIZE,
true);
} }
private Map<String, Object> buildContentOptions() { private Map<String, Object> buildContentOptions() {
@ -437,7 +438,8 @@ public class FollowingFragment extends BaseFragment implements
0, 0,
0, 0,
currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage, currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage,
Helper.CONTENT_PAGE_SIZE); Helper.CONTENT_PAGE_SIZE,
true);
} }
private List<String> getChannelIds() { private List<String> getChannelIds() {

View file

@ -210,7 +210,8 @@ public class ShuffleFragment extends BaseFragment {
121, // 2 minutes or less 121, // 2 minutes or less
1, 1,
currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage, currentClaimSearchPage == 0 ? 1 : currentClaimSearchPage,
PAGE_SIZE); PAGE_SIZE,
true);
} }
public void onStart() { public void onStart() {

View file

@ -373,7 +373,7 @@ public final class Lbry {
// build claim search for surf mode // build claim search for surf mode
public static Map<String, Object> buildClaimSearchOptions( public static Map<String, Object> buildClaimSearchOptions(
String claimType, List<String> notTags, List<String> channelIds, List<String> orderBy, long maxDuration, int limitClaimsPerChannel, int page, int pageSize) { String claimType, List<String> notTags, List<String> channelIds, List<String> orderBy, long maxDuration, int limitClaimsPerChannel, int page, int pageSize, boolean hasSource) {
return buildClaimSearchOptions( return buildClaimSearchOptions(
Collections.singletonList(claimType), Collections.singletonList(claimType),
null, null,
@ -385,7 +385,8 @@ public final class Lbry {
maxDuration, maxDuration,
limitClaimsPerChannel, limitClaimsPerChannel,
page, page,
pageSize); pageSize,
hasSource);
} }
public static Map<String, Object> buildClaimSearchOptions( public static Map<String, Object> buildClaimSearchOptions(
@ -397,7 +398,8 @@ public final class Lbry {
List<String> orderBy, List<String> orderBy,
String releaseTime, String releaseTime,
int page, int page,
int pageSize) { int pageSize,
boolean hasSource) {
return buildClaimSearchOptions( return buildClaimSearchOptions(
Collections.singletonList(claimType), Collections.singletonList(claimType),
anyTags, anyTags,
@ -409,7 +411,8 @@ public final class Lbry {
0, 0,
0, 0,
page, page,
pageSize); pageSize,
hasSource);
} }
public static Map<String, Object> buildClaimSearchOptions( public static Map<String, Object> buildClaimSearchOptions(
@ -423,7 +426,8 @@ public final class Lbry {
long maxDuration, long maxDuration,
int limitClaimsPerChannel, int limitClaimsPerChannel,
int page, int page,
int pageSize) { int pageSize,
boolean hasSource) {
Map<String, Object> options = new HashMap<>(); Map<String, Object> options = new HashMap<>();
if (claimType != null && claimType.size() > 0) { if (claimType != null && claimType.size() > 0) {
options.put("claim_type", claimType); options.put("claim_type", claimType);
@ -441,6 +445,12 @@ public final class Lbry {
options.put("limit_claims_per_channel", limitClaimsPerChannel); options.put("limit_claims_per_channel", limitClaimsPerChannel);
} }
if (hasSource) {
options.put("has_source", true);
} else {
options.put("has_no_source", true);
}
addClaimSearchListOption("any_tags", anyTags, options); addClaimSearchListOption("any_tags", anyTags, options);
addClaimSearchListOption("not_tags", notTags, options); addClaimSearchListOption("not_tags", notTags, options);
addClaimSearchListOption("channel_ids", channelIds, options); addClaimSearchListOption("channel_ids", channelIds, options);