diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-08-14 14:39:03 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-08-14 14:39:03 -0700 |
commit | 5034ab86a0663f4a4d81556bcf0f14069a33b7b3 (patch) | |
tree | 853e9057c50833e4f125cbce5900eb72ce9b0ce8 | |
parent | 936e916f5515a1ad651ca4ece7aac0969f1c191b (diff) | |
download | dsub-5034ab86a0663f4a4d81556bcf0f14069a33b7b3.tar.gz dsub-5034ab86a0663f4a4d81556bcf0f14069a33b7b3.tar.bz2 dsub-5034ab86a0663f4a4d81556bcf0f14069a33b7b3.zip |
When saving current list, save the name used
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 14 |
1 files changed, 11 insertions, 3 deletions
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<MusicDirectory.Entry> songs, boolean getSuggestion) {
+ protected void createNewPlaylist(final List<MusicDirectory.Entry> 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);
+ }
+ }
}
}
})
|