Skip to content

Commit

Permalink
Allow searchbar to find tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Xwilarg committed Oct 11, 2024
1 parent 8fa35c7 commit 4a90b34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/src/getMusics.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ function displaySongs(musics, id, filter, doesSort, doesShuffle, count) {
res = []
for (const elem of musics)
{
if (elem.name.toLowerCase().includes(filter) ||
if ((elem.tags && elem.tags.some(x => x.toLowerCase().includes(filter))) ||
elem.name.toLowerCase().includes(filter) ||
(elem.artist != null && elem.artist.toLowerCase().includes(filter)) ||
wanakana.toRomaji(elem.name).toLowerCase().includes(filter) ||
(elem.artist != null && wanakana.toRomaji(elem.artist).toLowerCase().includes(filter)))
Expand Down Expand Up @@ -325,7 +326,7 @@ function displaySongs(musics, id, filter, doesSort, doesShuffle, count) {
<div id="song-edit-content-${id}-${elem.id}" hidden>
<form class="song-edit-form" id="song-edit-form-${id}-${elem.id}">
<select name="Tags" multiple>
${currentTags}
${selectTags}
</select>
<input type="submit" />
</form>
Expand Down

0 comments on commit 4a90b34

Please sign in to comment.