From 5034ab86a0663f4a4d81556bcf0f14069a33b7b3 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 14 Aug 2014 14:39:03 -0700 Subject: When saving current list, save the name used --- .../daneren2005/dsub/fragments/SubsonicFragment.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/github/daneren2005') diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 3b691c36..a1a69f0a 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -923,7 +923,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR }.execute(); } - protected void createNewPlaylist(final List songs, boolean getSuggestion) { + protected void createNewPlaylist(final List songs, final boolean getSuggestion) { View layout = context.getLayoutInflater().inflate(R.layout.save_playlist, null); final EditText playlistNameView = (EditText) layout.findViewById(R.id.save_playlist_name); final CheckBox overwriteCheckBox = (CheckBox) layout.findViewById(R.id.save_playlist_overwrite); @@ -955,10 +955,18 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR .setPositiveButton(R.string.common_save, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { + String playlistName = String.valueOf(playlistNameView.getText()); if(overwriteCheckBox.isChecked()) { - overwritePlaylist(songs, String.valueOf(playlistNameView.getText()), getDownloadService().getSuggestedPlaylistId()); + overwritePlaylist(songs, playlistName, getDownloadService().getSuggestedPlaylistId()); } else { - createNewPlaylist(songs, String.valueOf(playlistNameView.getText())); + createNewPlaylist(songs, playlistName); + + if(getSuggestion) { + DownloadService downloadService = getDownloadService(); + if(downloadService != null) { + downloadService.setSuggestedPlaylistName(playlistName, null); + } + } } } }) -- cgit v1.2.3