diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-12-27 21:59:20 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-12-27 21:59:20 -0800 |
commit | daa707419ba4d362093bc14e6d71410ce49af7f5 (patch) | |
tree | 8c6075737667fc79fb83f1caa2215e23e1bf7bc1 /src/github | |
parent | bae8f83ddab6a485850d765af677173ea61a58bb (diff) | |
parent | dcaca5481f71838a271c100e99821023d31061ba (diff) | |
download | dsub-daa707419ba4d362093bc14e6d71410ce49af7f5.tar.gz dsub-daa707419ba4d362093bc14e6d71410ce49af7f5.tar.bz2 dsub-daa707419ba4d362093bc14e6d71410ce49af7f5.zip |
Merge branch 'master' into DLNA
Conflicts:
AndroidManifest.xml
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/util/ImageLoader.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/util/ImageLoader.java b/src/github/daneren2005/dsub/util/ImageLoader.java index 0342b6c9..48ff39ca 100644 --- a/src/github/daneren2005/dsub/util/ImageLoader.java +++ b/src/github/daneren2005/dsub/util/ImageLoader.java @@ -110,7 +110,16 @@ public class ImageLoader { color = COLORS[0]; } else { key = getKey(entry.getId() + "unknown", size); - color = COLORS[Math.abs(entry.getAlbum().hashCode()) % COLORS.length]; + + String hash; + if(entry.getAlbum() != null) { + hash = entry.getAlbum(); + } else if(entry.getArtist() != null) { + hash = entry.getArtist(); + } else { + hash = entry.getId(); + } + color = COLORS[Math.abs(hash.hashCode()) % COLORS.length]; } Bitmap bitmap = cache.get(key); if(bitmap == null) { |