mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
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:
parent
cd8b06f544
commit
9d5d89d648
2 changed files with 20 additions and 15 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue