Merge pull request #137 from lbryio/search-fix
fix: remove mediaType when searching for files
This commit is contained in:
commit
3de93cc745
2 changed files with 6 additions and 4 deletions
5
dist/bundle.es.js
vendored
5
dist/bundle.es.js
vendored
|
@ -773,10 +773,11 @@ const getSearchQueryString = (query, options = {}, includeUserOptions = false) =
|
||||||
const queryParams = [`s=${encodedQuery}`, `size=${options.size || DEFAULT_SEARCH_SIZE}`, `from=${options.from || DEFAULT_SEARCH_RESULT_FROM}`];
|
const queryParams = [`s=${encodedQuery}`, `size=${options.size || DEFAULT_SEARCH_SIZE}`, `from=${options.from || DEFAULT_SEARCH_RESULT_FROM}`];
|
||||||
|
|
||||||
if (includeUserOptions) {
|
if (includeUserOptions) {
|
||||||
queryParams.push(`claimType=${options[SEARCH_OPTIONS.CLAIM_TYPE]}`);
|
const claimType = options[SEARCH_OPTIONS.CLAIM_TYPE];
|
||||||
|
queryParams.push(`claimType=${claimType}`);
|
||||||
|
|
||||||
// If they are only searching for channels, strip out the media info
|
// If they are only searching for channels, strip out the media info
|
||||||
if (options[SEARCH_OPTIONS.CLAIM_TYPE] !== SEARCH_OPTIONS.INCLUDE_CHANNELS) {
|
if (!claimType.includes(SEARCH_OPTIONS.INCLUDE_CHANNELS)) {
|
||||||
queryParams.push(`mediaType=${[SEARCH_OPTIONS.MEDIA_FILE, SEARCH_OPTIONS.MEDIA_AUDIO, SEARCH_OPTIONS.MEDIA_VIDEO, SEARCH_OPTIONS.MEDIA_TEXT, SEARCH_OPTIONS.MEDIA_IMAGE, SEARCH_OPTIONS.MEDIA_APPLICATION].reduce((acc, currentOption) => options[currentOption] ? `${acc}${currentOption},` : acc, '')}`);
|
queryParams.push(`mediaType=${[SEARCH_OPTIONS.MEDIA_FILE, SEARCH_OPTIONS.MEDIA_AUDIO, SEARCH_OPTIONS.MEDIA_VIDEO, SEARCH_OPTIONS.MEDIA_TEXT, SEARCH_OPTIONS.MEDIA_IMAGE, SEARCH_OPTIONS.MEDIA_APPLICATION].reduce((acc, currentOption) => options[currentOption] ? `${acc}${currentOption},` : acc, '')}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,10 +46,11 @@ export const getSearchQueryString = (
|
||||||
];
|
];
|
||||||
|
|
||||||
if (includeUserOptions) {
|
if (includeUserOptions) {
|
||||||
queryParams.push(`claimType=${options[SEARCH_OPTIONS.CLAIM_TYPE]}`);
|
const claimType = options[SEARCH_OPTIONS.CLAIM_TYPE];
|
||||||
|
queryParams.push(`claimType=${claimType}`);
|
||||||
|
|
||||||
// If they are only searching for channels, strip out the media info
|
// If they are only searching for channels, strip out the media info
|
||||||
if (options[SEARCH_OPTIONS.CLAIM_TYPE] !== SEARCH_OPTIONS.INCLUDE_CHANNELS) {
|
if (!claimType.includes(SEARCH_OPTIONS.INCLUDE_CHANNELS)) {
|
||||||
queryParams.push(
|
queryParams.push(
|
||||||
`mediaType=${[
|
`mediaType=${[
|
||||||
SEARCH_OPTIONS.MEDIA_FILE,
|
SEARCH_OPTIONS.MEDIA_FILE,
|
||||||
|
|
Loading…
Reference in a new issue