3
0
mirror of https://github.com/Qortal/ear-bump.git synced 2025-01-28 22:02:19 +00:00

Search songs/playlists by title/description

This commit is contained in:
QuickMythril 2024-01-31 02:37:38 -05:00
parent 17493aa8d6
commit 78f9989877
3 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,7 @@ const SearchInput = () => {
}
return (
<Input
placeholder="What do you want to listen to? by title"
placeholder="What do you want to listen to?"
onChange={(e) => dispatch(setQueriedValue(e.target.value))}
onKeyDown={handleInputKeyDown}
/>

View File

@ -30,7 +30,7 @@ export const SearchInputPlaylist = () => {
return (
<div className="flex items-center">
<Input
placeholder="What do you want to listen to? by title"
placeholder="What do you want to listen to?"
onChange={(e) => {
dispatch(setQueriedValuePlaylist(e.target.value))
}}

View File

@ -120,9 +120,9 @@ export const useFetchSongs = () => {
if (!queriedValue) return
dispatch(setIsLoadingGlobal(true))
const offset = songListQueried.length
const query = `earbump_song_`
const identifier = `earbump_song_`
const replaceSpacesWithUnderscore = queriedValue.toLowerCase().replace(/ /g, '_');
const identifier = replaceSpacesWithUnderscore
const query = replaceSpacesWithUnderscore
const url = `/arbitrary/resources/search?mode=ALL&service=AUDIO&query=${query}&identifier=${identifier}&limit=20&includemetadata=true&offset=${offset}&reverse=true&excludeblocked=true&includestatus=true`
const response = await fetch(url, {
method: 'GET',
@ -530,9 +530,9 @@ export const useFetchSongs = () => {
try {
if (!queriedValuePlaylist) return
const offset = playlistQueried.length
const query = `earbump_playlist_`
const identifier = `earbump_playlist_`
const replaceSpacesWithUnderscore = queriedValuePlaylist.toLowerCase().replace(/ /g, '_');
const identifier = replaceSpacesWithUnderscore
const query = replaceSpacesWithUnderscore
const url = `/arbitrary/resources/search?mode=ALL&service=PLAYLIST&query=${query}&identifier=${identifier}&limit=20&includemetadata=false&offset=${offset}&reverse=true&excludeblocked=true&includestatus=false`
const response = await fetch(url, {
method: 'GET',