mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-16 17:22:23 +03:00
Fix wrong support for empty cover art url.
Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
parent
009567c83e
commit
acde5b9473
@ -18,6 +18,8 @@
|
||||
*/
|
||||
package org.moire.ultrasonic.domain;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@ -352,6 +354,7 @@ public class MusicDirectory
|
||||
this.bitRate = bitRate;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getCoverArt()
|
||||
{
|
||||
return coverArt;
|
||||
|
@ -21,6 +21,7 @@ package org.moire.ultrasonic.service;
|
||||
import android.content.Context;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.PowerManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import org.moire.ultrasonic.domain.MusicDirectory;
|
||||
@ -457,8 +458,7 @@ public class DownloadFile
|
||||
{
|
||||
try
|
||||
{
|
||||
if (song.getCoverArt() != null)
|
||||
{
|
||||
if (!TextUtils.isEmpty(song.getCoverArt())) {
|
||||
int size = Util.getMinDisplayMetric(context);
|
||||
musicService.getCoverArt(context, song, size, true, true, null);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import android.graphics.Bitmap;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import org.moire.ultrasonic.R;
|
||||
@ -654,7 +655,7 @@ public class RESTMusicService implements MusicService {
|
||||
Log.d(TAG, "Loading cover art for: " + entry);
|
||||
|
||||
final String id = entry.getCoverArt();
|
||||
if (id == null || id.isEmpty()) {
|
||||
if (TextUtils.isEmpty(id)) {
|
||||
return null; // Can't load
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.TransitionDrawable;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@ -179,8 +180,7 @@ public class ImageLoader implements Runnable
|
||||
|
||||
String coverArt = entry.getCoverArt();
|
||||
|
||||
if (coverArt == null)
|
||||
{
|
||||
if (TextUtils.isEmpty(coverArt)) {
|
||||
setUnknownImage(view, large);
|
||||
return;
|
||||
}
|
||||
@ -230,8 +230,7 @@ public class ImageLoader implements Runnable
|
||||
|
||||
String coverArt = entry.getCoverArt();
|
||||
|
||||
if (coverArt == null)
|
||||
{
|
||||
if (TextUtils.isEmpty(coverArt)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user