aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-02-09 16:01:20 -0800
committerScott Jackson <daneren2005@gmail.com>2015-02-09 16:01:20 -0800
commit91bfd2f1813458cab64f6c40b3f5c22d32b802f7 (patch)
tree7635d957fe5a335cc8856d7e21c22425d2826f9b /src
parent7b393cf7061c3e60601b14961ca99f1de94531ff (diff)
downloaddsub-91bfd2f1813458cab64f6c40b3f5c22d32b802f7.tar.gz
dsub-91bfd2f1813458cab64f6c40b3f5c22d32b802f7.tar.bz2
dsub-91bfd2f1813458cab64f6c40b3f5c22d32b802f7.zip
#446 Delete parent folder if we deleted the last song in a folder
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/DownloadFile.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/DownloadFile.java b/src/github/daneren2005/dsub/service/DownloadFile.java
index 04dc537a..505e4a6d 100644
--- a/src/github/daneren2005/dsub/service/DownloadFile.java
+++ b/src/github/daneren2005/dsub/service/DownloadFile.java
@@ -267,9 +267,11 @@ public class DownloadFile implements BufferFile {
deleteFromStore();
// Delete all possible versions of the file
+ File parent = partialFile.getParentFile();
Util.delete(partialFile);
Util.delete(completeFile);
Util.delete(saveFile);
+ FileUtil.deleteEmptyDir(parent);
}
public void unpin() {