aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-01-19 18:19:26 -0800
committerScott Jackson <daneren2005@gmail.com>2015-01-19 18:19:26 -0800
commitc5fb2b3f7bc65368bca141bd68654fecb7ce80aa (patch)
tree2d1b12bc129c55e79ec008b42b08770ab5d42a04 /src
parent94dc19fec688edb6439ccfbf0966fcd9acdbc79d (diff)
parent97000f52056a2367f169f122842c5df6eedd62db (diff)
downloaddsub-c5fb2b3f7bc65368bca141bd68654fecb7ce80aa.tar.gz
dsub-c5fb2b3f7bc65368bca141bd68654fecb7ce80aa.tar.bz2
dsub-c5fb2b3f7bc65368bca141bd68654fecb7ce80aa.zip
Merge branch 'master' into DLNA
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/util/ImageLoader.java24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/github/daneren2005/dsub/util/ImageLoader.java b/src/github/daneren2005/dsub/util/ImageLoader.java
index 97c7f626..a6f482eb 100644
--- a/src/github/daneren2005/dsub/util/ImageLoader.java
+++ b/src/github/daneren2005/dsub/util/ImageLoader.java
@@ -448,7 +448,7 @@ public class ImageLoader {
String url = artistInfo.getImageUrl();
// Figure out whether we are going to get a artist image or the standard image
- if(url != null) {
+ if(url != null && !"".equals(url.trim())) {
// If getting the artist image fails for any reason, retry for the standard version
subTask = new ViewUrlTask(mContext, mView, url, mSize) {
@Override
@@ -460,13 +460,23 @@ public class ImageLoader {
subTask = null;
}
};
- } else if(mEntry != null && mEntry.getCoverArt() != null) {
- subTask = new ViewImageTask(mContext, mEntry, mSize, mSaveSize, mIsNowPlaying, mView, mCrossfade);
} else {
- // If entry is null as well, we need to just set as a blank image
- Bitmap bitmap = getUnknownImage(mEntry, mSize);
- mDrawable = Util.createDrawableFromBitmap(mContext, bitmap);
- return null;
+ if (mEntry != null && mEntry.getCoverArt() == null && mEntry.isDirectory() && !Util.isOffline(context)) {
+ // Try to lookup child cover art
+ MusicDirectory.Entry firstChild = FileUtil.lookupChild(context, mEntry, true);
+ if (firstChild != null) {
+ mEntry.setCoverArt(firstChild.getCoverArt());
+ }
+ }
+
+ if (mEntry != null && mEntry.getCoverArt() != null) {
+ subTask = new ViewImageTask(mContext, mEntry, mSize, mSaveSize, mIsNowPlaying, mView, mCrossfade);
+ } else {
+ // If entry is null as well, we need to just set as a blank image
+ Bitmap bitmap = getUnknownImage(mEntry, mSize);
+ mDrawable = Util.createDrawableFromBitmap(mContext, bitmap);
+ return null;
+ }
}
// Execute whichever way we decided to go