Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
notifiy user that voice controlled playback cannot succeed, if podcas…
Browse files Browse the repository at this point in the history
…t list is empty
  • Loading branch information
y20k committed Dec 6, 2019
1 parent 366b3e6 commit 1f8c15f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId 'org.y20k.escapepod'
minSdkVersion 25
targetSdkVersion 29
versionCode 19
versionName '0.8.1'
versionCode 20
versionName '0.8.2'
resConfigs "en", "de", "nl", "nb-rNO", "pt"
}

Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/org/y20k/escapepod/PlayerService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import android.support.v4.media.MediaMetadataCompat
import android.support.v4.media.session.MediaControllerCompat
import android.support.v4.media.session.MediaSessionCompat
import android.support.v4.media.session.PlaybackStateCompat
import android.widget.Toast
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat
import androidx.core.os.bundleOf
Expand Down Expand Up @@ -563,6 +564,9 @@ class PlayerService(): MediaBrowserServiceCompat(), Player.EventListener, Corout
val episodeMediaItem: MediaBrowserCompat.MediaItem? = collectionProvider.getNewestEpisode()
if (episodeMediaItem != null) {
onPlayFromMediaId(episodeMediaItem.mediaId, null)
} else {
Toast.makeText(this@PlayerService, R.string.toast_message_error_no_podcast_found, Toast.LENGTH_LONG).show()
LogHelper.e(TAG, "Unable to start playback. Please add a podcast and download an episode first.")
}
} else {
// try to match podcast name and voice query - and start newest episode of that podcast
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<string name="toast_message_downloading_episode">Downloading Episode.</string>
<string name="toast_message_error_feed_not_supported">Unsupported feed (application/Atom+XML).</string>
<string name="toast_message_error_missing_storage_permission">Grant \"Read Storage\" permission to open this file.</string>
<string name="toast_message_error_no_podcast_found">Unable to start playback. Please add a podcast first.</string>
<string name="toast_message_error_refreshing_cover">Could not refresh cover. The feed does not contain a cover reference.</string>
<string name="toast_message_error_validation_audio_references">RSS validation: Feed does not contain any audio references.</string>
<string name="toast_message_error_validation_missing_cover">RSS validation: Feed does not contain a cover reference.</string>
Expand Down
2 changes: 1 addition & 1 deletion metadata/en-US/changelogs/18.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# v0.8.0 - Gehen Die Leute

**2019-12-08**
**2019-12-05**

- basic podcast search on the gpodder.net service
- Portuguese language version
Expand Down
2 changes: 1 addition & 1 deletion metadata/en-US/changelogs/19.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# v0.8.1 - Gehen Die Leute

**2019-12-08**
**2019-12-05**

- prevents a crash caused by playback command issued via voice control, when podcast list is still empty
5 changes: 5 additions & 0 deletions metadata/en-US/changelogs/20.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# v0.8.2 - Gehen Die Leute

**2019-12-06**

- notifies user that voice controlled playback cannot succeed, if podcast list is empty.

0 comments on commit 1f8c15f

Please sign in to comment.