Revert "bring in ClaimListDiscover changes from odysee"
This reverts commit 56cd1ddfa7
.
This commit is contained in:
parent
56cd1ddfa7
commit
892fb6f687
3 changed files with 59 additions and 71 deletions
|
@ -136,7 +136,7 @@
|
||||||
"imagesloaded": "^4.1.4",
|
"imagesloaded": "^4.1.4",
|
||||||
"json-loader": "^0.5.4",
|
"json-loader": "^0.5.4",
|
||||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||||
"lbry-redux": "lbryio/lbry-redux#ba5d6b84bec6bdb2f0a1a6b23e695212c65f650e",
|
"lbry-redux": "lbryio/lbry-redux#04015155796bc588bdf5b10762cfc874e6a1b00c",
|
||||||
"lbryinc": "lbryio/lbryinc#db0663fcc4a64cb082b6edc5798fafa67eb4300f",
|
"lbryinc": "lbryio/lbryinc#db0663fcc4a64cb082b6edc5798fafa67eb4300f",
|
||||||
"lint-staged": "^7.0.2",
|
"lint-staged": "^7.0.2",
|
||||||
"localforage": "^1.7.1",
|
"localforage": "^1.7.1",
|
||||||
|
@ -191,7 +191,6 @@
|
||||||
"three": "^0.93.0",
|
"three": "^0.93.0",
|
||||||
"three-full": "^17.1.0",
|
"three-full": "^17.1.0",
|
||||||
"tiny-relative-date": "^1.3.0",
|
"tiny-relative-date": "^1.3.0",
|
||||||
"uuid": "^8.3.0",
|
|
||||||
"tree-kill": "^1.1.0",
|
"tree-kill": "^1.1.0",
|
||||||
"unist-util-visit": "^1.4.1",
|
"unist-util-visit": "^1.4.1",
|
||||||
"video.js": "7.8.4",
|
"video.js": "7.8.4",
|
||||||
|
@ -215,7 +214,7 @@
|
||||||
"yarn": "^1.3"
|
"yarn": "^1.3"
|
||||||
},
|
},
|
||||||
"lbrySettings": {
|
"lbrySettings": {
|
||||||
"lbrynetDaemonVersion": "0.82.0",
|
"lbrynetDaemonVersion": "0.81.0",
|
||||||
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
|
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
|
||||||
"lbrynetDaemonDir": "static/daemon",
|
"lbrynetDaemonDir": "static/daemon",
|
||||||
"lbrynetDaemonFileName": "lbrynet",
|
"lbrynetDaemonFileName": "lbrynet",
|
||||||
|
|
|
@ -58,7 +58,6 @@ type Props = {
|
||||||
infiniteScroll?: Boolean,
|
infiniteScroll?: Boolean,
|
||||||
feeAmount?: string,
|
feeAmount?: string,
|
||||||
tileLayout: boolean,
|
tileLayout: boolean,
|
||||||
hideFilters?: boolean,
|
|
||||||
maxPages?: number,
|
maxPages?: number,
|
||||||
forceShowReposts?: boolean,
|
forceShowReposts?: boolean,
|
||||||
};
|
};
|
||||||
|
@ -102,7 +101,6 @@ function ClaimListDiscover(props: Props) {
|
||||||
feeAmount,
|
feeAmount,
|
||||||
uris,
|
uris,
|
||||||
tileLayout,
|
tileLayout,
|
||||||
hideFilters = false,
|
|
||||||
claimIds,
|
claimIds,
|
||||||
maxPages,
|
maxPages,
|
||||||
forceShowReposts = false,
|
forceShowReposts = false,
|
||||||
|
@ -161,7 +159,7 @@ function ClaimListDiscover(props: Props) {
|
||||||
no_totals: boolean,
|
no_totals: boolean,
|
||||||
any_tags?: Array<string>,
|
any_tags?: Array<string>,
|
||||||
not_tags: Array<string>,
|
not_tags: Array<string>,
|
||||||
channel_ids?: Array<string>,
|
channel_ids: Array<string>,
|
||||||
claim_ids?: Array<string>,
|
claim_ids?: Array<string>,
|
||||||
not_channel_ids: Array<string>,
|
not_channel_ids: Array<string>,
|
||||||
order_by: Array<string>,
|
order_by: Array<string>,
|
||||||
|
@ -180,6 +178,7 @@ function ClaimListDiscover(props: Props) {
|
||||||
// no_totals makes it so the sdk doesn't have to calculate total number pages for pagination
|
// no_totals makes it so the sdk doesn't have to calculate total number pages for pagination
|
||||||
// it's faster, but we will need to remove it if we start using total_pages
|
// it's faster, but we will need to remove it if we start using total_pages
|
||||||
no_totals: true,
|
no_totals: true,
|
||||||
|
channel_ids: channelIdsParam || [],
|
||||||
not_channel_ids:
|
not_channel_ids:
|
||||||
// If channelIdsParam were passed in, we don't need not_channel_ids
|
// If channelIdsParam were passed in, we don't need not_channel_ids
|
||||||
!channelIdsParam && hiddenUris && hiddenUris.length ? hiddenUris.map(hiddenUri => hiddenUri.split('#')[1]) : [],
|
!channelIdsParam && hiddenUris && hiddenUris.length ? hiddenUris.map(hiddenUri => hiddenUri.split('#')[1]) : [],
|
||||||
|
@ -197,52 +196,50 @@ function ClaimListDiscover(props: Props) {
|
||||||
options.reposted_claim_id = repostedClaimId;
|
options.reposted_claim_id = repostedClaimId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (claimType !== CS.CLAIM_CHANNEL) {
|
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
|
||||||
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
|
options.release_time = `>${Math.floor(
|
||||||
|
moment()
|
||||||
|
.subtract(1, freshnessParam)
|
||||||
|
.startOf('hour')
|
||||||
|
.unix()
|
||||||
|
)}`;
|
||||||
|
} else if (orderParam === CS.ORDER_BY_NEW || orderParam === CS.ORDER_BY_TRENDING) {
|
||||||
|
// Warning - hack below
|
||||||
|
// If users are following more than 10 channels or tags, limit results to stuff less than a year old
|
||||||
|
// For more than 20, drop it down to 6 months
|
||||||
|
// This helps with timeout issues for users that are following a ton of stuff
|
||||||
|
// https://github.com/lbryio/lbry-sdk/issues/2420
|
||||||
|
if (
|
||||||
|
(options.channel_ids && options.channel_ids.length > 20) ||
|
||||||
|
(options.any_tags && options.any_tags.length > 20)
|
||||||
|
) {
|
||||||
options.release_time = `>${Math.floor(
|
options.release_time = `>${Math.floor(
|
||||||
moment()
|
moment()
|
||||||
.subtract(1, freshnessParam)
|
.subtract(3, CS.FRESH_MONTH)
|
||||||
.startOf('hour')
|
.startOf('week')
|
||||||
|
.unix()
|
||||||
|
)}`;
|
||||||
|
} else if (
|
||||||
|
(options.channel_ids && options.channel_ids.length > 10) ||
|
||||||
|
(options.any_tags && options.any_tags.length > 10)
|
||||||
|
) {
|
||||||
|
options.release_time = `>${Math.floor(
|
||||||
|
moment()
|
||||||
|
.subtract(1, CS.FRESH_YEAR)
|
||||||
|
.startOf('week')
|
||||||
|
.unix()
|
||||||
|
)}`;
|
||||||
|
} else {
|
||||||
|
// Hack for at least the New page until https://github.com/lbryio/lbry-sdk/issues/2591 is fixed
|
||||||
|
options.release_time = `<${Math.floor(
|
||||||
|
moment()
|
||||||
|
.startOf('minute')
|
||||||
.unix()
|
.unix()
|
||||||
)}`;
|
)}`;
|
||||||
} else if (orderParam === CS.ORDER_BY_NEW || orderParam === CS.ORDER_BY_TRENDING) {
|
|
||||||
// Warning - hack below
|
|
||||||
// If users are following more than 10 channels or tags, limit results to stuff less than a year old
|
|
||||||
// For more than 20, drop it down to 6 months
|
|
||||||
// This helps with timeout issues for users that are following a ton of stuff
|
|
||||||
// https://github.com/lbryio/lbry-sdk/issues/2420
|
|
||||||
if (
|
|
||||||
(options.channel_ids && options.channel_ids.length > 20) ||
|
|
||||||
(options.any_tags && options.any_tags.length > 20)
|
|
||||||
) {
|
|
||||||
options.release_time = `>${Math.floor(
|
|
||||||
moment()
|
|
||||||
.subtract(3, CS.FRESH_MONTH)
|
|
||||||
.startOf('week')
|
|
||||||
.unix()
|
|
||||||
)}`;
|
|
||||||
} else if (
|
|
||||||
(options.channel_ids && options.channel_ids.length > 10) ||
|
|
||||||
(options.any_tags && options.any_tags.length > 10)
|
|
||||||
) {
|
|
||||||
options.release_time = `>${Math.floor(
|
|
||||||
moment()
|
|
||||||
.subtract(1, CS.FRESH_YEAR)
|
|
||||||
.startOf('week')
|
|
||||||
.unix()
|
|
||||||
)}`;
|
|
||||||
} else {
|
|
||||||
// Hack for at least the New page until https://github.com/lbryio/lbry-sdk/issues/2591 is fixed
|
|
||||||
options.release_time = `<${Math.floor(
|
|
||||||
moment()
|
|
||||||
.startOf('minute')
|
|
||||||
.unix()
|
|
||||||
)}`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (feeAmountParam && claimType !== CS.CLAIM_CHANNEL) {
|
if (feeAmountParam) {
|
||||||
options.fee_amount = feeAmountParam;
|
options.fee_amount = feeAmountParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,10 +247,6 @@ function ClaimListDiscover(props: Props) {
|
||||||
options.claim_ids = claimIds;
|
options.claim_ids = claimIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channelIdsParam) {
|
|
||||||
options.channel_ids = channelIdsParam;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (durationParam) {
|
if (durationParam) {
|
||||||
if (durationParam === CS.DURATION_SHORT) {
|
if (durationParam === CS.DURATION_SHORT) {
|
||||||
options.duration = '<=1800';
|
options.duration = '<=1800';
|
||||||
|
@ -430,7 +423,6 @@ function ClaimListDiscover(props: Props) {
|
||||||
hiddenNsfwMessage={hiddenNsfwMessage}
|
hiddenNsfwMessage={hiddenNsfwMessage}
|
||||||
setPage={setPage}
|
setPage={setPage}
|
||||||
tileLayout={tileLayout}
|
tileLayout={tileLayout}
|
||||||
hideFilters={hideFilters}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ type Props = {
|
||||||
tileLayout: boolean,
|
tileLayout: boolean,
|
||||||
doSetClientSetting: (string, boolean, ?boolean) => void,
|
doSetClientSetting: (string, boolean, ?boolean) => void,
|
||||||
setPage: number => void,
|
setPage: number => void,
|
||||||
hideFilters: boolean,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function ClaimListHeader(props: Props) {
|
function ClaimListHeader(props: Props) {
|
||||||
|
@ -54,7 +53,6 @@ function ClaimListHeader(props: Props) {
|
||||||
tileLayout,
|
tileLayout,
|
||||||
doSetClientSetting,
|
doSetClientSetting,
|
||||||
setPage,
|
setPage,
|
||||||
hideFilters,
|
|
||||||
} = props;
|
} = props;
|
||||||
const { action, push, location } = useHistory();
|
const { action, push, location } = useHistory();
|
||||||
const { search } = location;
|
const { search } = location;
|
||||||
|
@ -205,25 +203,24 @@ function ClaimListHeader(props: Props) {
|
||||||
<div className="claim-search__wrapper">
|
<div className="claim-search__wrapper">
|
||||||
<div className="claim-search__top">
|
<div className="claim-search__top">
|
||||||
<div className="claim-search__top-row">
|
<div className="claim-search__top-row">
|
||||||
{!hideFilters &&
|
{CS.ORDER_BY_TYPES.map(type => (
|
||||||
CS.ORDER_BY_TYPES.map(type => (
|
<Button
|
||||||
<Button
|
key={type}
|
||||||
key={type}
|
button="alt"
|
||||||
button="alt"
|
onClick={e =>
|
||||||
onClick={e =>
|
handleChange({
|
||||||
handleChange({
|
key: CS.ORDER_BY_KEY,
|
||||||
key: CS.ORDER_BY_KEY,
|
value: type,
|
||||||
value: type,
|
})
|
||||||
})
|
}
|
||||||
}
|
className={classnames(`button-toggle button-toggle--${type}`, {
|
||||||
className={classnames(`button-toggle button-toggle--${type}`, {
|
'button-toggle--active': orderParam === type,
|
||||||
'button-toggle--active': orderParam === type,
|
})}
|
||||||
})}
|
disabled={orderBy}
|
||||||
disabled={orderBy}
|
icon={toCapitalCase(type)}
|
||||||
icon={toCapitalCase(type)}
|
label={__(toCapitalCase(type))}
|
||||||
label={__(toCapitalCase(type))}
|
/>
|
||||||
/>
|
))}
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue