diff --git a/lib/src/patch_notes/patch_notes.dart b/lib/src/patch_notes/patch_notes.dart index 423587394..78816abe7 100644 --- a/lib/src/patch_notes/patch_notes.dart +++ b/lib/src/patch_notes/patch_notes.dart @@ -133,8 +133,19 @@ const kPatchNotes20240308 = 'Hello MusicPod Users ๐Ÿ’™๐Ÿง๐Ÿงก\n' '\n\nIf you like MusicPod please consider sponsoring me ๐Ÿ™:' '\n'; -const kRecentPatchNotesDisposed = kPatchNotes20240308disposed; -const kRecentPatchNotesTitle = kPatchNotesTitle20240308; -const kRecentPatchNotes = kPatchNotes20240308; +// 2024 03 11 +const kPatchNotes20240311disposed = 'patchNotes20240311disposed'; +const kPatchNotesTitle20240311 = 'Patch notes: 2024-03-11'; +const kPatchNotes20240311 = 'Hello MusicPod Users ๐Ÿ’™๐Ÿง๐Ÿงก\n' + '\n* New features:' + '\n* drag and drop files to a playlist page' + '\n* fast add media from the + button on a playlist page' + '\n* + several bug fixes' + '\n\nIf you like MusicPod please consider sponsoring me ๐Ÿ™:' + '\n'; + +const kRecentPatchNotesDisposed = kPatchNotes20240311disposed; +const kRecentPatchNotesTitle = kPatchNotesTitle20240311; +const kRecentPatchNotes = kPatchNotes20240311; const kPatchNotesDisposed = 'kPatchNotesDisposed'; diff --git a/lib/src/radio/radio_search_page.dart b/lib/src/radio/radio_search_page.dart index 48a7c88d6..dbb2d8526 100644 --- a/lib/src/radio/radio_search_page.dart +++ b/lib/src/radio/radio_search_page.dart @@ -57,28 +57,37 @@ class _RadioSearchPageState extends ConsumerState { builder: (context, snapshot) { if (!snapshot.hasData) { return LoadingGrid(limit: widget.limit); - } - if (snapshot.data?.isEmpty == true) { - return NoSearchResultPage( - icons: const AnimatedEmoji(AnimatedEmojis.dog), - message: Text(context.l10n.noStationFound), - ); } else { - return GridView.builder( - padding: gridPadding, - gridDelegate: audioCardGridDelegate, - itemCount: snapshot.data?.length, - itemBuilder: (context, index) { - final station = snapshot.data?.elementAt(index); - return StationCard( - station: station, - startPlaylist: playerModel.startPlaylist, - isStarredStation: libraryModel.isStarredStation, - unstarStation: libraryModel.unStarStation, - starStation: libraryModel.addStarredStation, - ); - }, - ); + if (snapshot.data?.isEmpty == true) { + return NoSearchResultPage( + icons: AnimatedEmoji( + widget.searchQuery?.isNotEmpty == true + ? AnimatedEmojis.dog + : AnimatedEmojis.drum, + ), + message: Text( + widget.searchQuery?.isNotEmpty == true + ? context.l10n.noStationFound + : '', + ), + ); + } else { + return GridView.builder( + padding: gridPadding, + gridDelegate: audioCardGridDelegate, + itemCount: snapshot.data?.length, + itemBuilder: (context, index) { + final station = snapshot.data?.elementAt(index); + return StationCard( + station: station, + startPlaylist: playerModel.startPlaylist, + isStarredStation: libraryModel.isStarredStation, + unstarStation: libraryModel.unStarStation, + starStation: libraryModel.addStarredStation, + ); + }, + ); + } } }, ); diff --git a/lib/src/radio/radio_service.dart b/lib/src/radio/radio_service.dart index 35e5ee7ca..8183f94a8 100644 --- a/lib/src/radio/radio_service.dart +++ b/lib/src/radio/radio_service.dart @@ -63,50 +63,31 @@ class RadioService { } RadioBrowserListResponse? response; + final parameters = InputParameters( + hidebroken: true, + order: 'stationcount', + limit: limit, + ); try { if (name?.isEmpty == false) { - response = await _radioBrowserApi!.getStationsByName( - name: name!, - parameters: InputParameters( - hidebroken: true, - order: 'stationcount', - limit: limit, - ), - ); + response = await _radioBrowserApi! + .getStationsByName(name: name!, parameters: parameters); } else if (country?.isEmpty == false) { - response = await _radioBrowserApi!.getStationsByCountry( - country: country!, - parameters: InputParameters( - hidebroken: true, - order: 'stationcount', - limit: limit, - ), - ); - } else if (tag != null) { - response = await _radioBrowserApi!.getStationsByTag( - tag: tag, - parameters: InputParameters( - hidebroken: true, - order: 'stationcount', - limit: limit, - ), - ); + response = await _radioBrowserApi! + .getStationsByCountry(country: country!, parameters: parameters); + } else if (tag?.isEmpty == false) { + response = await _radioBrowserApi! + .getStationsByTag(tag: tag!, parameters: parameters); } else if (state?.isEmpty == false) { - response = await _radioBrowserApi!.getStationsByState( - state: state!, - parameters: InputParameters( - hidebroken: true, - order: 'stationcount', - limit: limit, - ), - ); + response = await _radioBrowserApi! + .getStationsByState(state: state!, parameters: parameters); } } on Exception catch (e) { if (e is SocketException) { return []; } } - return response?.items; + return response?.items ?? []; } List? _tags; diff --git a/pubspec.yaml b/pubspec.yaml index 4a12a79ab..069fae20c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: musicpod description: Ubuntu music, radio and podcast player. -version: 1.1.2 +version: 1.2.0 publish_to: "none"