From 1f330ce8e20e55937a012176d748867fd7e36320 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sat, 8 Sep 2012 21:21:17 -0700 Subject: Fix for Offline playing error --- subsonic-android/AndroidManifest.xml | 4 ++-- .../src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'subsonic-android') diff --git a/subsonic-android/AndroidManifest.xml b/subsonic-android/AndroidManifest.xml index 8cc8eb82..8956ef8d 100644 --- a/subsonic-android/AndroidManifest.xml +++ b/subsonic-android/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="10" + android:versionName="3.3.5.1"> diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index b7f6813e..bec6c727 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -458,14 +458,14 @@ public class DownloadServiceImpl extends Service implements DownloadService { } if (mRemoteControlClient != null) { - MusicDirectory.Entry currentSong = currentPlaying == null ? null: currentPlaying.getSong(); + MusicDirectory.Entry currentSong = ((currentPlaying == null) ? null: currentPlaying.getSong()); // Update the remote controls mRemoteControlClient.editMetadata(true) .putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, currentSong == null ? null : currentSong.getArtist()) .putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, currentSong == null ? null : currentSong.getAlbum()) .putString(MediaMetadataRetriever.METADATA_KEY_TITLE, currentSong == null ? null : currentSong.getTitle()) - .putLong(MediaMetadataRetriever.METADATA_KEY_DURATION, currentSong == null ? 0 : currentSong.getDuration()) - .apply(); + .putLong(MediaMetadataRetriever.METADATA_KEY_DURATION, (currentSong == null) ? 0 : ((currentSong.getDuration() == null) ? 0 : currentSong.getDuration())) + .apply(); if (currentSong == null) { mRemoteControlClient.editMetadata(true) .putBitmap(RemoteControlClient.MetadataEditor.BITMAP_KEY_ARTWORK, null) @@ -702,10 +702,8 @@ public class DownloadServiceImpl extends Service implements DownloadService { if (show) { Util.showPlayingNotification(this, this, handler, currentPlaying.getSong()); - Log.d(TAG, "Showing"); } else if (hide) { Util.hidePlayingNotification(this, this, handler); - Log.d(TAG, "Hiding"); } if (playerState == STARTED) { -- cgit v1.2.3