From c7e667242c74710e4e1907079c28348efc5ec6b8 Mon Sep 17 00:00:00 2001 From: Arnaud Barisain-Monrose Date: Mon, 1 Dec 2014 00:26:03 +0100 Subject: [PATCH] Fix CUE problem for contextual menu --- JMPDComm/src/main/java/org/a0z/mpd/MPD.java | 6 +++++- .../java/com/namelessdev/mpdroid/fragments/FSFragment.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/JMPDComm/src/main/java/org/a0z/mpd/MPD.java b/JMPDComm/src/main/java/org/a0z/mpd/MPD.java index b6507af036..635383b24e 100644 --- a/JMPDComm/src/main/java/org/a0z/mpd/MPD.java +++ b/JMPDComm/src/main/java/org/a0z/mpd/MPD.java @@ -274,7 +274,11 @@ public void add(final FilesystemTreeEntry music, final boolean replace, final bo throws IOException, MPDException { final CommandQueue commandQueue = new CommandQueue(); - commandQueue.add(MPDPlaylist.addCommand(music.getFullPath())); + if (music instanceof PlaylistFile) { + commandQueue.add(MPDPlaylist.loadCommand(music.getFullPath())); + } else { + commandQueue.add(MPDPlaylist.addCommand(music.getFullPath())); + } add(commandQueue, replace, play); } diff --git a/MPDroid/src/main/java/com/namelessdev/mpdroid/fragments/FSFragment.java b/MPDroid/src/main/java/com/namelessdev/mpdroid/fragments/FSFragment.java index fe0016b729..8fbc1e4143 100644 --- a/MPDroid/src/main/java/com/namelessdev/mpdroid/fragments/FSFragment.java +++ b/MPDroid/src/main/java/com/namelessdev/mpdroid/fragments/FSFragment.java @@ -69,7 +69,11 @@ protected void add(final Item item, final boolean replace, final boolean play) { final Directory toAdd = mCurrentDirectory.getDirectory(item.getName()); if (toAdd == null) { mApp.oMPDAsyncHelper.oMPD.add((FilesystemTreeEntry) item, replace, play); - Tools.notifyUser(R.string.songAdded, item); + if (item instanceof PlaylistFile) { + Tools.notifyUser(R.string.playlistAdded, item); + } else { + Tools.notifyUser(R.string.songAdded, item); + } } else { // Valid directory mApp.oMPDAsyncHelper.oMPD.add(toAdd, replace, play);