aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-08-30 11:44:18 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-08-30 11:44:18 -0700
commit0e21e82d49336b490c04f7f3a4628aae5e7ee4b2 (patch)
treea1ffe9de5bb6af0f926185790abccf5e9c052873 /src
parent5949caafe3d598268373ceeda8cf416dc96f6ac6 (diff)
downloaddsub-0e21e82d49336b490c04f7f3a4628aae5e7ee4b2.tar.gz
dsub-0e21e82d49336b490c04f7f3a4628aae5e7ee4b2.tar.bz2
dsub-0e21e82d49336b490c04f7f3a4628aae5e7ee4b2.zip
Load metadata in background thread when needed
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/view/SongView.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/view/SongView.java b/src/github/daneren2005/dsub/view/SongView.java
index 3106d38c..f76f4f2a 100644
--- a/src/github/daneren2005/dsub/view/SongView.java
+++ b/src/github/daneren2005/dsub/view/SongView.java
@@ -164,6 +164,11 @@ public class SongView extends UpdateView implements Checkable {
partialFile = downloadFile.getPartialFile();
partialFileExists = partialFile.exists();
isStarred = song.isStarred();
+
+ // Check if needs to load metadata: check against all fields that we know are null in offline mode
+ if(song.getBitrate() == null && song.getDuration() == null && song.getDiscNumber() == null && isWorkDone) {
+ song.loadMetadata(downloadFile.getCompleteFile());
+ }
}
@Override