Merge pull request #1218 from mfietz/issue/1217-onError-handling
Error handling for getMediaSize observable
This commit is contained in:
commit
fc4d9225bf
|
@ -61,6 +61,7 @@ public class AdapterUtils {
|
|||
txtvPos.setText("");
|
||||
}
|
||||
}, error -> {
|
||||
txtvPos.setText("");
|
||||
Log.e(TAG, Log.getStackTraceString(error));
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.content.Context;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.text.format.DateUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -124,13 +125,17 @@ public class AllEpisodesListAdapter extends BaseAdapter {
|
|||
holder.txtvDuration.setText("{fa-spinner}");
|
||||
Iconify.addIcons(holder.txtvDuration);
|
||||
NetworkUtils.getFeedMediaSizeObservable(media)
|
||||
.subscribe(size -> {
|
||||
.subscribe(
|
||||
size -> {
|
||||
if (size > 0) {
|
||||
holder.txtvDuration.setText(Converter.byteToString(size));
|
||||
} else {
|
||||
holder.txtvDuration.setText("");
|
||||
}
|
||||
});
|
||||
}, error -> {
|
||||
holder.txtvDuration.setText("");
|
||||
Log.e(TAG, Log.getStackTraceString(error));
|
||||
});
|
||||
} else {
|
||||
holder.txtvDuration.setText("");
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.content.Context;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.text.format.DateUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -147,13 +148,17 @@ public class QueueListAdapter extends BaseAdapter {
|
|||
holder.progressLeft.setText("{fa-spinner}");
|
||||
Iconify.addIcons(holder.progressLeft);
|
||||
NetworkUtils.getFeedMediaSizeObservable(media)
|
||||
.subscribe(size -> {
|
||||
.subscribe(
|
||||
size -> {
|
||||
if (size > 0) {
|
||||
holder.progressLeft.setText(Converter.byteToString(size));
|
||||
} else {
|
||||
holder.progressLeft.setText("");
|
||||
}
|
||||
});
|
||||
}, error -> {
|
||||
holder.progressLeft.setText("");
|
||||
Log.e(TAG, Log.getStackTraceString(error));
|
||||
});
|
||||
} else {
|
||||
holder.progressLeft.setText("");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue