Skip to content

Commit

Permalink
added search field on the local songs page (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
gokadzev committed Feb 9, 2023
1 parent 82ac06a commit 065f37c
Show file tree
Hide file tree
Showing 2 changed files with 290 additions and 97 deletions.
10 changes: 10 additions & 0 deletions lib/API/musify.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ Future<List> searchPlaylist(String query) async {
.toList();
}

Future<List> searchLocalSong(String query) async {
final _localSongs = await getLocalSongs();

return _localSongs
.where(
(song) => song.displayName.toLowerCase().contains(query.toLowerCase()),
)
.toList();
}

Future<List> getSearchSuggestions(String query) async {
const baseUrl =
'https://suggestqueries.google.com/complete/search?client=firefox&ds=yt&q=';
Expand Down
Loading

0 comments on commit 065f37c

Please sign in to comment.