use limit_claims_per_channel on homepage

This commit is contained in:
Sean Yesmunt 2020-08-20 11:23:10 -04:00
parent 17feef93df
commit 84084a7c41
2 changed files with 12 additions and 0 deletions

View file

@ -25,6 +25,7 @@ type Props = {
claimType?: Array<string>, claimType?: Array<string>,
timestamp?: string, timestamp?: string,
feeAmount?: string, feeAmount?: string,
limitClaimsPerChannel?: number,
}; };
function ClaimTilesDiscover(props: Props) { function ClaimTilesDiscover(props: Props) {
@ -45,6 +46,7 @@ function ClaimTilesDiscover(props: Props) {
prefixUris, prefixUris,
timestamp, timestamp,
feeAmount, feeAmount,
limitClaimsPerChannel,
} = props; } = props;
const { location } = useHistory(); const { location } = useHistory();
const urlParams = new URLSearchParams(location.search); const urlParams = new URLSearchParams(location.search);
@ -64,6 +66,7 @@ function ClaimTilesDiscover(props: Props) {
claim_type?: Array<string>, claim_type?: Array<string>,
timestamp?: string, timestamp?: string,
fee_amount?: string, fee_amount?: string,
limit_claims_per_channel?: number,
} = { } = {
page_size: pageSize, page_size: pageSize,
claim_type: claimType || undefined, claim_type: claimType || undefined,
@ -88,6 +91,10 @@ function ClaimTilesDiscover(props: Props) {
options.fee_amount = feeAmountParam; options.fee_amount = feeAmountParam;
} }
if (limitClaimsPerChannel) {
options.limit_claims_per_channel = limitClaimsPerChannel;
}
// https://github.com/lbryio/lbry-desktop/issues/3774 // https://github.com/lbryio/lbry-desktop/issues/3774
if (hideReposts) { if (hideReposts) {
if (Array.isArray(options.claim_type)) { if (Array.isArray(options.claim_type)) {

View file

@ -116,6 +116,7 @@ export default function getHomePageRowData(
orderBy: ['release_time'], orderBy: ['release_time'],
pageSize: 12, pageSize: 12,
channelIds: YOUTUBER_CHANNEL_IDS, channelIds: YOUTUBER_CHANNEL_IDS,
limitClaimsPerChannel: 1,
releaseTime: `>${Math.floor( releaseTime: `>${Math.floor(
moment() moment()
.subtract(1, 'months') .subtract(1, 'months')
@ -173,6 +174,7 @@ export default function getHomePageRowData(
pageSize: showPersonalizedChannels || showPersonalizedTags ? 4 : 8, pageSize: showPersonalizedChannels || showPersonalizedTags ? 4 : 8,
orderBy: ['effective_amount'], orderBy: ['effective_amount'],
claimType: ['stream'], claimType: ['stream'],
limitClaimsPerChannel: 2,
releaseTime: `>${Math.floor( releaseTime: `>${Math.floor(
moment() moment()
.subtract(1, 'day') .subtract(1, 'day')
@ -189,6 +191,7 @@ export default function getHomePageRowData(
claimType: ['stream'], claimType: ['stream'],
tags: ['2020protests'], tags: ['2020protests'],
pageSize: 4, pageSize: 4,
limitClaimsPerChannel: 1,
}, },
}; };
@ -207,6 +210,7 @@ export default function getHomePageRowData(
options: { options: {
pageSize: 4, pageSize: 4,
claimType: ['stream'], claimType: ['stream'],
limitClaimsPerChannel: 1,
releaseTime: `<${Math.floor( releaseTime: `<${Math.floor(
moment() moment()
.subtract(6, 'month') .subtract(6, 'month')
@ -230,6 +234,7 @@ export default function getHomePageRowData(
options: { options: {
tags: followedTags.map(tag => tag.name), tags: followedTags.map(tag => tag.name),
claimType: ['stream'], claimType: ['stream'],
limitClaimsPerChannel: 2,
}, },
}; };