mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Require only single query for search
This commit is contained in:
parent
e56350c1c2
commit
255a131f3b
5 changed files with 22 additions and 9 deletions
|
|
@ -64,11 +64,18 @@ export async function getSearchResults(
|
|||
params: LyricSearchQuery,
|
||||
): Promise<InternetProviderLyricSearchResponse[] | null> {
|
||||
let result: AxiosResponse<GeniusSearchResponse>;
|
||||
|
||||
const searchQuery = [params.artist, params.name].join(' ');
|
||||
|
||||
if (!searchQuery) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
result = await axios.get(SEARCH_URL, {
|
||||
params: {
|
||||
per_page: '5',
|
||||
q: `${params.artist} ${params.name}`,
|
||||
q: searchQuery,
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
|
|
|
|||
|
|
@ -21,12 +21,19 @@ export async function getSearchResults(
|
|||
params: LyricSearchQuery,
|
||||
): Promise<InternetProviderLyricSearchResponse[] | null> {
|
||||
let result: AxiosResponse<any, any>;
|
||||
|
||||
const searchQuery = [params.artist, params.name].join(' ');
|
||||
|
||||
if (!searchQuery) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
result = await axios.get(SEARCH_URL, {
|
||||
params: {
|
||||
limit: 5,
|
||||
offset: 0,
|
||||
s: `${params.artist} ${params.name}`,
|
||||
s: searchQuery,
|
||||
type: '1',
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue