diff --git a/src/com/thejoshwa/ultrasonic/androidapp/service/DownloadServiceImpl.java b/src/com/thejoshwa/ultrasonic/androidapp/service/DownloadServiceImpl.java index 5f4d1be5..a0965767 100644 --- a/src/com/thejoshwa/ultrasonic/androidapp/service/DownloadServiceImpl.java +++ b/src/com/thejoshwa/ultrasonic/androidapp/service/DownloadServiceImpl.java @@ -991,14 +991,20 @@ public class DownloadServiceImpl extends Service implements DownloadService { UltraSonicAppWidgetProvider4x3.getInstance().notifyChange(this, this, this.playerState == PlayerState.STARTED, false); UltraSonicAppWidgetProvider4x4.getInstance().notifyChange(this, this, this.playerState == PlayerState.STARTED, false); SubsonicTabActivity tabInstance = SubsonicTabActivity.getInstance(); - + + Entry song = null; + + if (currentPlaying != null) { + song = currentPlaying.getSong(); + } + if (show) { int size = Util.getNotificationImageSize(this); - Bitmap bitmap = FileUtil.getAlbumArtBitmap(this, currentPlaying.getSong(), size, true); + Bitmap bitmap = FileUtil.getAlbumArtBitmap(this, song , size, true); if (tabInstance != null) { tabInstance.nowPlayingImage = bitmap; - tabInstance.showNotification(handler, currentPlaying.getSong(), this, this.notification, this.playerState); + tabInstance.showNotification(handler, song, this, this.notification, this.playerState); tabInstance.showNowPlaying(); } } else { diff --git a/src/com/thejoshwa/ultrasonic/androidapp/util/FileUtil.java b/src/com/thejoshwa/ultrasonic/androidapp/util/FileUtil.java index 014e7b73..2522609a 100644 --- a/src/com/thejoshwa/ultrasonic/androidapp/util/FileUtil.java +++ b/src/com/thejoshwa/ultrasonic/androidapp/util/FileUtil.java @@ -108,7 +108,6 @@ public class FileUtil { if (albumArtFile.exists()) { final BitmapFactory.Options opt = new BitmapFactory.Options(); - if (size > 0) { opt.inJustDecodeBounds = true; BitmapFactory.decodeFile(albumArtFile.getPath(), opt); diff --git a/src/com/thejoshwa/ultrasonic/androidapp/view/SongView.java b/src/com/thejoshwa/ultrasonic/androidapp/view/SongView.java index 54b96eac..9562c969 100644 --- a/src/com/thejoshwa/ultrasonic/androidapp/view/SongView.java +++ b/src/com/thejoshwa/ultrasonic/androidapp/view/SongView.java @@ -123,8 +123,13 @@ public class SongView extends UpdateView implements Checkable { if (artistTextView != null) { artistTextView.setText(artist); } - - durationTextView.setText(Util.formatTotalDuration(song.getDuration())); + + Integer duration = song.getDuration(); + + if (duration != null) { + durationTextView.setText(Util.formatTotalDuration(duration)); + } + starImageView.setImageDrawable(song.getStarred() ? Util.getDrawableFromAttribute(getContext(), R.attr.star_full) : Util.getDrawableFromAttribute(getContext(), R.attr.star_hollow)); checkedTextView.setVisibility(checkable && !song.isVideo() ? View.VISIBLE : View.GONE);