diff --git a/fastlane/metadata/android/en-US/changelogs/66.txt b/fastlane/metadata/android/en-US/changelogs/66.txt new file mode 100644 index 000000000..1d21a4641 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/66.txt @@ -0,0 +1,8 @@ +Bug fixes + +- Fixed remove feature in custom playlists + +Enhancements + +- Added undo dialog after removing song from custom playlists +- Made various quality and performance improvements for app stability and speed \ No newline at end of file diff --git a/lib/API/musify.dart b/lib/API/musify.dart index 5ddd09351..f5fa115b7 100644 --- a/lib/API/musify.dart +++ b/lib/API/musify.dart @@ -126,7 +126,11 @@ String createCustomPlaylist( return '${context.l10n()!.addedSuccess}!'; } -String addSongInCustomPlaylist(String playlistName, dynamic song, {int? indexToInsert}) { +String addSongInCustomPlaylist( + String playlistName, + dynamic song, { + int? indexToInsert, +}) { final customPlaylist = userCustomPlaylists.firstWhere( (playlist) => playlist['title'] == playlistName, orElse: () => null, @@ -134,8 +138,9 @@ String addSongInCustomPlaylist(String playlistName, dynamic song, {int? indexToI if (customPlaylist != null) { final List playlistSongs = customPlaylist['list']; - indexToInsert != null ? playlistSongs.insert(indexToInsert, song) : - playlistSongs.add(song); + indexToInsert != null + ? playlistSongs.insert(indexToInsert, song) + : playlistSongs.add(song); addOrUpdateData('user', 'customPlaylists', userCustomPlaylists); return 'Song added to custom playlist: $playlistName'; } else { @@ -143,14 +148,22 @@ String addSongInCustomPlaylist(String playlistName, dynamic song, {int? indexToI } } -void removeSongFromPlaylist(dynamic playlist, dynamic songToRemove, {int? removeOneAtIndex}) { +void removeSongFromPlaylist( + dynamic playlist, + dynamic songToRemove, { + int? removeOneAtIndex, +}) { if (playlist == null || playlist['list'] == null) return; final playlistSongs = List.from(playlist['list']); - removeOneAtIndex != null? playlistSongs.removeAt(removeOneAtIndex): - playlistSongs.removeWhere((song) => song['ytid'] == songToRemove['ytid']); + removeOneAtIndex != null + ? playlistSongs.removeAt(removeOneAtIndex) + : playlistSongs + .removeWhere((song) => song['ytid'] == songToRemove['ytid']); playlist['list'] = playlistSongs; - if(playlist['isCustom']) addOrUpdateData('user', 'customPlaylists', userCustomPlaylists); - else addOrUpdateData('user', 'playlists', userPlaylists); + if (playlist['isCustom']) + addOrUpdateData('user', 'customPlaylists', userCustomPlaylists); + else + addOrUpdateData('user', 'playlists', userPlaylists); } void removeUserPlaylist(String playlistId) { diff --git a/lib/API/version.dart b/lib/API/version.dart index fc4fae891..55f8b7f1f 100644 --- a/lib/API/version.dart +++ b/lib/API/version.dart @@ -1 +1 @@ -const appVersion = '6.5.1'; +const appVersion = '6.5.2'; diff --git a/pubspec.yaml b/pubspec.yaml index 7ca2c4a32..a0e23479f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ repository: https://github.com/gokadzev/Musify issue_tracker: https://github.com/gokadzev/Musify/issues publish_to: 'none' -version: 6.5.1+65 # run update.sh after changing the version +version: 6.5.2+66 # run update.sh after changing the version environment: sdk: '>=3.1.0 <4.0.0'