new: Separate toast for when all songs were skipped

Also, fixed grammatical issue in toast where they were all singular.
This commit is contained in:
SinTan1729 2025-10-06 21:58:41 -05:00
parent cd8b06f544
commit 9d5d89d648
No known key found for this signature in database
GPG key ID: 0538DD402EA50898
2 changed files with 20 additions and 15 deletions

View file

@ -81,20 +81,24 @@ public class PlaylistRepository {
} }
public void addSongToPlaylist(String playlistId, ArrayList<String> songsId) { public void addSongToPlaylist(String playlistId, ArrayList<String> songsId) {
App.getSubsonicClientInstance(false) if (songsId.isEmpty()) {
.getPlaylistClient() Toast.makeText(App.getContext(), App.getContext().getString(R.string.playlist_chooser_dialog_toast_all_skipped), Toast.LENGTH_SHORT).show();
.updatePlaylist(playlistId, null, true, songsId, null) } else{
.enqueue(new Callback<ApiResponse>() { App.getSubsonicClientInstance(false)
@Override .getPlaylistClient()
public void onResponse(@NonNull Call<ApiResponse> call, @NonNull Response<ApiResponse> response) { .updatePlaylist(playlistId, null, true, songsId, null)
Toast.makeText(App.getContext(), App.getContext().getString(R.string.playlist_chooser_dialog_toast_add_success), Toast.LENGTH_SHORT).show(); .enqueue(new Callback<ApiResponse>() {
} @Override
public void onResponse(@NonNull Call<ApiResponse> call, @NonNull Response<ApiResponse> response) {
Toast.makeText(App.getContext(), App.getContext().getString(R.string.playlist_chooser_dialog_toast_add_success), Toast.LENGTH_SHORT).show();
}
@Override @Override
public void onFailure(@NonNull Call<ApiResponse> call, @NonNull Throwable t) { public void onFailure(@NonNull Call<ApiResponse> call, @NonNull Throwable t) {
Toast.makeText(App.getContext(), App.getContext().getString(R.string.playlist_chooser_dialog_toast_add_failure), Toast.LENGTH_SHORT).show(); Toast.makeText(App.getContext(), App.getContext().getString(R.string.playlist_chooser_dialog_toast_add_failure), Toast.LENGTH_SHORT).show();
} }
}); });
}
} }
public void createPlaylist(String playlistId, String name, ArrayList<String> songsId) { public void createPlaylist(String playlistId, String name, ArrayList<String> songsId) {

View file

@ -207,8 +207,9 @@
<string name="playlist_chooser_dialog_negative_button">Cancel</string> <string name="playlist_chooser_dialog_negative_button">Cancel</string>
<string name="playlist_chooser_dialog_neutral_button">Create</string> <string name="playlist_chooser_dialog_neutral_button">Create</string>
<string name="playlist_chooser_dialog_title">Add to a playlist</string> <string name="playlist_chooser_dialog_title">Add to a playlist</string>
<string name="playlist_chooser_dialog_toast_add_success">Added song to playlist</string> <string name="playlist_chooser_dialog_toast_add_success">Added song(s) to playlist</string>
<string name="playlist_chooser_dialog_toast_add_failure">Failed to add song to playlist</string> <string name="playlist_chooser_dialog_toast_add_failure">Failed to add song(s) to playlist</string>
<string name="playlist_chooser_dialog_toast_all_skipped">All songs were skipped as duplicates</string>
<string name="playlist_counted_tracks">%1$d tracks • %2$s</string> <string name="playlist_counted_tracks">%1$d tracks • %2$s</string>
<string name="playlist_duration">Duration • %1$s</string> <string name="playlist_duration">Duration • %1$s</string>
<string name="playlist_editor_dialog_action_delete_toast">Long press to delete</string> <string name="playlist_editor_dialog_action_delete_toast">Long press to delete</string>