diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-05-27 21:59:14 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-05-27 21:59:14 -0700 |
commit | 108feea089881e4f9d29cd3e938d03e2e353f289 (patch) | |
tree | 46d9643315e50f36c1512df82880b1123e34c467 /src | |
parent | e2742428339a32831f4cf007bbbf4c9de2372acf (diff) | |
download | dsub-108feea089881e4f9d29cd3e938d03e2e353f289.tar.gz dsub-108feea089881e4f9d29cd3e938d03e2e353f289.tar.bz2 dsub-108feea089881e4f9d29cd3e938d03e2e353f289.zip |
#351 Don't include folders in rebase
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java b/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java index d968f82e..e705c54d 100644 --- a/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java +++ b/src/github/daneren2005/dsub/service/parser/MusicDirectoryParser.java @@ -61,18 +61,21 @@ public class MusicDirectoryParser extends MusicDirectoryEntryParser { Entry entry = parseEntry(artist); entry.setGrandParent(dir.getParent()); - // Check if duplicates - Entry duplicate = titleMap.get(entry.getTitle()); - if(duplicate != null) { - // Check if the first already has been rebased or not - if(duplicate.getTitle().equals(entry.getTitle())) { - duplicate.rebaseTitleOffPath(); + // Only check for songs + if(!entry.isDirectory()) { + // Check if duplicates + Entry duplicate = titleMap.get(entry.getTitle()); + if (duplicate != null) { + // Check if the first already has been rebased or not + if (duplicate.getTitle().equals(entry.getTitle())) { + duplicate.rebaseTitleOffPath(); + } + + // Rebase if this is the second instance of this title found + entry.rebaseTitleOffPath(); + } else { + titleMap.put(entry.getTitle(), entry); } - - // Rebase if this is the second instance of this title found - entry.rebaseTitleOffPath(); - } else { - titleMap.put(entry.getTitle(), entry); } dir.addChild(entry); |