diff --git a/PlayWallCore/src/main/java/de/tobias/playpad/pad/Pad.java b/PlayWallCore/src/main/java/de/tobias/playpad/pad/Pad.java index a8f1b91048dc0f0ef9aec9d3a21f2bd655a7f31f..640152d2b33b2f6992abfd9186a63aea5a85664b 100644 --- a/PlayWallCore/src/main/java/de/tobias/playpad/pad/Pad.java +++ b/PlayWallCore/src/main/java/de/tobias/playpad/pad/Pad.java @@ -372,6 +372,7 @@ public class Pad { } public void removePath(MediaPath path) { + getContent().unloadMedia(path); mediaPaths.remove(path); } @@ -382,6 +383,12 @@ public class Pad { } } + public void clearPaths() { + while (!mediaPaths.isEmpty()) { + removePath(mediaPaths.get(0)); + } + } + /** * Get the status of the pad. * diff --git a/PlayWallCore/src/main/java/de/tobias/playpad/pad/content/PadContentFactory.java b/PlayWallCore/src/main/java/de/tobias/playpad/pad/content/PadContentFactory.java index 71c86385f9fd163beabaa07da6a76c3ffb1cb161..611654dc50e21a013911b95a49e9024936c9b14b 100644 --- a/PlayWallCore/src/main/java/de/tobias/playpad/pad/content/PadContentFactory.java +++ b/PlayWallCore/src/main/java/de/tobias/playpad/pad/content/PadContentFactory.java @@ -61,6 +61,13 @@ public abstract class PadContentFactory extends Component implements ContentDrag currentPad.getController().getView().showBusyView(true); } - currentPad.setPath(files.get(0).toPath()); + if (currentPad.getContent() instanceof Playlistable) { + currentPad.clearPaths(); + for (File file : files) { + currentPad.addPath(file.toPath()); + } + } else { + currentPad.setPath(files.get(0).toPath()); + } } }