diff --git a/lib/online_art/online_art_service.dart b/lib/online_art/online_art_service.dart index 1707a75..78615d1 100644 --- a/lib/online_art/online_art_service.dart +++ b/lib/online_art/online_art_service.dart @@ -59,9 +59,8 @@ class OnlineArtService { final _store = {}; String? put({required String key, String? url}) { - return _store.containsKey(key) - ? _store.update(key, (value) => url) - : _store.putIfAbsent(key, () => url); + _store[key] = url; + return url; } String? get(String? icyTitle) => icyTitle == null ? null : _store[icyTitle]; diff --git a/lib/podcasts/podcast_service.dart b/lib/podcasts/podcast_service.dart index 5000299..6bce91a 100644 --- a/lib/podcasts/podcast_service.dart +++ b/lib/podcasts/podcast_service.dart @@ -45,7 +45,7 @@ class PodcastService { }) async { SearchResult res; try { - if (searchQuery == null || searchQuery.isEmpty == true) { + if (searchQuery == null || searchQuery.isEmpty) { res = await _search.charts( genre: podcastGenre == PodcastGenre.all ? '' : podcastGenre.id, limit: limit, @@ -65,7 +65,7 @@ class PodcastService { attribute: attribute, ); } - if (res.successful == false) { + if (!res.successful) { throw Exception( 'Search failed: ${res.lastError} ${res.lastErrorType.name}', );