searchAlbums method
Searches for albums matching the given query.
query: The search query string.market: An optional market (country code) to filter results.offset: The index of the first result to return.limit: The maximum number of results to return.
Returns a list of SimplifiedAlbum objects.
Implementation
Future<List<SimplifiedAlbum>> searchAlbums(
String query, {
String? market,
int offset = 0,
int limit = 20,
}) async {
// Perform a search with the specified type (album)
final results = await search(
query,
type: [SearchType.album],
market: market,
offset: offset,
limit: limit,
);
// Filter the results to only include albums
return results.whereType<SimplifiedAlbum>().toList();
}