Skip to content

Native Android client for Spotify, built with Jetpack Compose

When Spotify refuses the account's audio licences, the message says what to do (wait and play again, check the account in the official app) in 11 languages, and the ad the page is stuck on during the pause no longer shows as an advertisement with a spinner (#134)

kota-zo58df8da57cfb
diff --git a/base/api-spotify/src/main/kotlin/app/myspoti/spotify/SpotifyPlayer.kt b/base/api-spotify/src/main/kotlin/app/myspoti/spotify/SpotifyPlayer.kt
index e226cbdb..aa24bd81 100644
--- a/base/api-spotify/src/main/kotlin/app/myspoti/spotify/SpotifyPlayer.kt
+++ b/base/api-spotify/src/main/kotlin/app/myspoti/spotify/SpotifyPlayer.kt
@@ -190,6 +190,9 @@ class SpotifyPlayer(private val bridge: Bridge, private val scope: CoroutineScop
/** Spotify refuses this account its audio licences: playback was paused, the UI says so. */
val licencesRefused: kotlinx.coroutines.flow.SharedFlow<Unit> = _licencesRefused
+ /** True from the pause the refusal made until the user plays: an ad the page is stuck on meanwhile is the refusal's, not an ad. */
+ val licencesHeld: Boolean get() = licenceRefusedHold
+
/** Repairs wait: held by the host ([recoveryHeld]), or licences refused ([licenceRefusedHold]). */
private fun repairsHeld(): Boolean = recoveryHeld() || licenceRefusedHold
diff --git a/base/app/src/main/java/com/music/spotui/di/SongPlayer.kt b/base/app/src/main/java/com/music/spotui/di/SongPlayer.kt
index 11d7cbe3..a7c7be83 100644
--- a/base/app/src/main/java/com/music/spotui/di/SongPlayer.kt
+++ b/base/app/src/main/java/com/music/spotui/di/SongPlayer.kt
@@ -316,7 +316,9 @@ object SongPlayer {
kotlinx.coroutines.delay(AD_SHOW_AFTER_MS)
// Spotify limiting playback holds every repair, the ad's too: the limit is what
// the user is told (its toast), not an ad for as long as it lasts (50 s seen).
- while (MyspotiRuntime.host.licenseLimited()) kotlinx.coroutines.delay(1_000)
+ // The same when it refuses the account its licences (#134): the ad it is stuck on
+ // stays out of the screens, the toast said why nothing plays.
+ while (MyspotiRuntime.host.licenseLimited() || MyspotiRuntime.spotify.player.licencesHeld) kotlinx.coroutines.delay(1_000)
}
onAdPlaying(on)
}
diff --git a/base/app/src/main/res/values-de/myspoti_strings.xml b/base/app/src/main/res/values-de/myspoti_strings.xml
index d951c343..2d047ba2 100644
--- a/base/app/src/main/res/values-de/myspoti_strings.xml
+++ b/base/app/src/main/res/values-de/myspoti_strings.xml
@@ -515,7 +515,7 @@
<string name="song_unavailable_skipped">%1$s ist nicht verfügbar und wurde übersprungen.</string>
<string name="song_unavailable">%1$s ist nicht verfügbar.</string>
<string name="songs_skipped_by_spotify">Spotify hat immer wieder Titel übersprungen, die es nicht abspielen konnte, daher wurde die Wiedergabe pausiert. Tippe auf Wiedergabe, um es erneut zu versuchen, oder prüfe dein Konto und deine Verbindung.</string>
- <string name="licences_refused_by_spotify">Spotify verweigert auf diesem Konto gerade die Wiedergabe (Lizenz abgelehnt), daher wurde die Wiedergabe pausiert. Tippe später auf Wiedergabe, um es erneut zu versuchen.</string>
+ <string name="licences_refused_by_spotify">Spotify verweigert auf diesem Konto gerade die Wiedergabe (Audiolizenz abgelehnt), daher wurde die Wiedergabe pausiert. Warte etwas und tippe auf Wiedergabe, um es erneut zu versuchen, und prüfe, ob das Konto in der offiziellen Spotify-App abspielt.</string>
<string name="playlist_leave">Playlist verlassen</string>
<string name="playlist_leave_confirm">%1$s verlassen? Du bist dann kein Mitwirkender mehr und kannst keine Titel mehr hinzufügen oder entfernen. Um wieder beizutreten, brauchst du einen neuen Einladungslink.</string>
<string name="playlist_leave_button">Verlassen</string>
diff --git a/base/app/src/main/res/values-el/myspoti_strings.xml b/base/app/src/main/res/values-el/myspoti_strings.xml
index 9e447954..4f1aeb77 100644
--- a/base/app/src/main/res/values-el/myspoti_strings.xml
+++ b/base/app/src/main/res/values-el/myspoti_strings.xml
@@ -515,7 +515,7 @@
<string name="song_unavailable_skipped">Το «%1$s» δεν είναι διαθέσιμο και παραλείφθηκε.</string>
<string name="song_unavailable">Το «%1$s» δεν είναι διαθέσιμο.</string>
<string name="songs_skipped_by_spotify">Το Spotify συνέχιζε να παραλείπει τραγούδια που δεν μπορούσε να αναπαραγάγει, οπότε η αναπαραγωγή τέθηκε σε παύση. Πατήστε αναπαραγωγή για νέα προσπάθεια ή ελέγξτε τον λογαριασμό και τη σύνδεσή σας.</string>
- <string name="licences_refused_by_spotify">Το Spotify αρνείται προς το παρόν την αναπαραγωγή τραγουδιών σε αυτόν τον λογαριασμό (η άδεια απορρίφθηκε), οπότε η αναπαραγωγή τέθηκε σε παύση. Πατήστε αναπαραγωγή για νέα προσπάθεια αργότερα.</string>
+ <string name="licences_refused_by_spotify">Το Spotify αρνείται προς το παρόν την αναπαραγωγή τραγουδιών σε αυτόν τον λογαριασμό (η άδεια ήχου απορρίφθηκε), οπότε η αναπαραγωγή τέθηκε σε παύση. Περιμένετε λίγο και πατήστε αναπαραγωγή για νέα προσπάθεια, και ελέγξτε ότι ο λογαριασμός παίζει στην επίσημη εφαρμογή Spotify.</string>
<string name="playlist_leave">Αποχώρηση από τη λίστα αναπαραγωγής</string>
<string name="playlist_leave_confirm">Αποχώρηση από το «%1$s»; Δεν θα είστε πλέον συνεργάτης και δεν θα μπορείτε να προσθέτετε ή να αφαιρείτε τραγούδια. Για να ξαναμπείτε, θα χρειαστείτε νέο σύνδεσμο πρόσκλησης.</string>
<string name="playlist_leave_button">Αποχώρηση</string>
diff --git a/base/app/src/main/res/values-es/myspoti_strings.xml b/base/app/src/main/res/values-es/myspoti_strings.xml
index 0b35dc2d..dc848672 100644
--- a/base/app/src/main/res/values-es/myspoti_strings.xml
+++ b/base/app/src/main/res/values-es/myspoti_strings.xml
@@ -515,7 +515,7 @@
<string name="song_unavailable_skipped">%1$s no está disponible y se omitió.</string>
<string name="song_unavailable">%1$s no está disponible.</string>
<string name="songs_skipped_by_spotify">Spotify seguía omitiendo canciones que no podía reproducir, así que la reproducción se pausó. Toca reproducir para intentarlo de nuevo, o revisa tu cuenta y tu conexión.</string>
- <string name="licences_refused_by_spotify">Spotify se niega por ahora a reproducir canciones en esta cuenta (licencia rechazada), así que la reproducción se pausó. Toca reproducir para intentarlo de nuevo más tarde.</string>
+ <string name="licences_refused_by_spotify">Spotify se niega ahora mismo a reproducir canciones en esta cuenta (licencia de audio rechazada), así que la reproducción se pausó. Espera un poco y toca reproducir para intentarlo de nuevo, y comprueba que la cuenta funciona en la aplicación oficial de Spotify.</string>
<string name="playlist_leave">Salir de la playlist</string>
<string name="playlist_leave_confirm">¿Salir de %1$s? Dejarás de ser colaborador y no podrás añadir ni quitar canciones. Para volver a unirte, necesitarás un nuevo enlace de invitación.</string>
<string name="playlist_leave_button">Salir</string>
diff --git a/base/app/src/main/res/values-fr/myspoti_strings.xml b/base/app/src/main/res/values-fr/myspoti_strings.xml
index a2df8c91..b6dc59be 100644
--- a/base/app/src/main/res/values-fr/myspoti_strings.xml
+++ b/base/app/src/main/res/values-fr/myspoti_strings.xml
@@ -445,7 +445,7 @@
<string name="song_unavailable_skipped">%1$s est indisponible et a été passé.</string>
<string name="song_unavailable">%1$s est indisponible.</string>
<string name="songs_skipped_by_spotify">Spotify enchaînait des morceaux qu’il ne pouvait pas lire : la lecture a été mise en pause. Appuyez sur lecture pour réessayer, ou vérifiez votre compte et votre connexion.</string>
- <string name="licences_refused_by_spotify">Spotify refuse pour l’instant de lire des morceaux sur ce compte (licence refusée) : la lecture a été mise en pause. Appuyez sur lecture pour réessayer plus tard.</string>
+ <string name="licences_refused_by_spotify">Spotify refuse pour l’instant de lire des morceaux sur ce compte (licence audio refusée) : la lecture a été mise en pause. Patientez un moment puis appuyez sur lecture pour réessayer, et vérifiez que le compte fonctionne dans l’application Spotify officielle.</string>
<string name="spotify_limited">Spotify limite la lecture pour le moment. Réessayez dans une minute.</string>
<string name="library_change_undone">Spotify a refusé la modification, votre bibliothèque est revenue comme avant</string>
<string name="blend_title">Mix à plusieurs</string>
diff --git a/base/app/src/main/res/values-it/myspoti_strings.xml b/base/app/src/main/res/values-it/myspoti_strings.xml
index 992f8b21..c21f31bd 100644
--- a/base/app/src/main/res/values-it/myspoti_strings.xml
+++ b/base/app/src/main/res/values-it/myspoti_strings.xml
@@ -515,7 +515,7 @@
<string name="song_unavailable_skipped">%1$s non è disponibile ed è stato saltato.</string>
<string name="song_unavailable">%1$s non è disponibile.</string>
<string name="songs_skipped_by_spotify">Spotify continuava a saltare brani che non riusciva a riprodurre, quindi la riproduzione è stata messa in pausa. Tocca riproduci per riprovare oppure controlla il tuo account e la connessione.</string>
- <string name="licences_refused_by_spotify">Spotify per ora rifiuta di riprodurre brani su questo account (licenza rifiutata), quindi la riproduzione è stata messa in pausa. Tocca riproduci per riprovare più tardi.</string>
+ <string name="licences_refused_by_spotify">Spotify per ora rifiuta di riprodurre brani su questo account (licenza audio rifiutata), quindi la riproduzione è stata messa in pausa. Aspetta un po’ e tocca riproduci per riprovare, e controlla che l’account funzioni nell’app ufficiale di Spotify.</string>
<string name="playlist_leave">Esci dalla playlist</string>
<string name="playlist_leave_confirm">Uscire da %1$s? Non sarai più un collaboratore e non potrai aggiungere o rimuovere brani. Per rientrare ti servirà un nuovo link di invito.</string>
<string name="playlist_leave_button">Esci</string>
diff --git a/base/app/src/main/res/values-pl/myspoti_strings.xml b/base/app/src/main/res/values-pl/myspoti_strings.xml
index b93f04eb..01402e52 100644
--- a/base/app/src/main/res/values-pl/myspoti_strings.xml
+++ b/base/app/src/main/res/values-pl/myspoti_strings.xml
@@ -540,7 +540,7 @@
<string name="song_unavailable_skipped">Utwór %1$s jest niedostępny i został pominięty.</string>
<string name="song_unavailable">Utwór %1$s jest niedostępny.</string>
<string name="songs_skipped_by_spotify">Spotify wciąż pomijał utwory, których nie mógł odtworzyć, więc odtwarzanie wstrzymano. Dotknij odtwarzania, aby spróbować ponownie, lub sprawdź konto i połączenie.</string>
- <string name="licences_refused_by_spotify">Spotify na razie odmawia odtwarzania utworów na tym koncie (licencja odrzucona), więc odtwarzanie wstrzymano. Dotknij odtwarzania, aby spróbować ponownie później.</string>
+ <string name="licences_refused_by_spotify">Spotify na razie odmawia odtwarzania utworów na tym koncie (licencja audio odrzucona), więc odtwarzanie wstrzymano. Poczekaj chwilę i dotknij odtwarzania, aby spróbować ponownie, oraz sprawdź, czy konto działa w oficjalnej aplikacji Spotify.</string>
<string name="playlist_member_listener">Słuchacz</string>
<string name="playlist_member_remove_collab">Usuń z grona współtwórców</string>
<string name="playlist_member_make_collab">Zrób współtwórcą</string>
diff --git a/base/app/src/main/res/values-pt-rBR/myspoti_strings.xml b/base/app/src/main/res/values-pt-rBR/myspoti_strings.xml
index 846bfb64..34e5c9b4 100644
--- a/base/app/src/main/res/values-pt-rBR/myspoti_strings.xml
+++ b/base/app/src/main/res/values-pt-rBR/myspoti_strings.xml
@@ -444,7 +444,7 @@
<string name="song_unavailable_skipped">%1$s está indisponível e foi pulada.</string>
<string name="song_unavailable">%1$s está indisponível.</string>
<string name="songs_skipped_by_spotify">O Spotify continuou pulando músicas que não conseguiu tocar, então a reprodução foi pausada. Toque em reproduzir para tentar de novo, ou verifique sua conta e sua conexão.</string>
- <string name="licences_refused_by_spotify">O Spotify está se recusando a tocar músicas nesta conta por ora (licença recusada), então a reprodução foi pausada. Toque em reproduzir para tentar de novo mais tarde.</string>
+ <string name="licences_refused_by_spotify">O Spotify está se recusando a tocar músicas nesta conta por ora (licença de áudio recusada), então a reprodução foi pausada. Aguarde um pouco e toque em reproduzir para tentar de novo, e confira se a conta funciona no app oficial do Spotify.</string>
<string name="spotify_limited">O Spotify está limitando a reprodução por um momento. Tente novamente em um minuto.</string>
<string name="library_change_undone">O Spotify recusou a alteração, sua biblioteca voltou ao que era</string>
<string name="blend_title">Blend</string>
diff --git a/base/app/src/main/res/values-pt/myspoti_strings.xml b/base/app/src/main/res/values-pt/myspoti_strings.xml
index 9c92218c..7c5cd131 100644
--- a/base/app/src/main/res/values-pt/myspoti_strings.xml
+++ b/base/app/src/main/res/values-pt/myspoti_strings.xml
@@ -515,7 +515,7 @@
<string name="song_unavailable_skipped">%1$s não está disponível e foi ignorada.</string>
<string name="song_unavailable">%1$s não está disponível.</string>
<string name="songs_skipped_by_spotify">O Spotify continuou pulando músicas que não conseguia reproduzir, então a reprodução foi pausada. Toque em reproduzir para tentar de novo ou verifique sua conta e sua conexão.</string>
- <string name="licences_refused_by_spotify">O Spotify está recusando reproduzir músicas nesta conta por enquanto (licença recusada), então a reprodução foi pausada. Toque em reproduzir para tentar de novo mais tarde.</string>
+ <string name="licences_refused_by_spotify">O Spotify está recusando reproduzir músicas nesta conta por enquanto (licença de áudio recusada), então a reprodução foi pausada. Aguarde um pouco e toque em reproduzir para tentar de novo, e verifique se a conta funciona no app oficial do Spotify.</string>
<string name="playlist_leave">Sair da playlist</string>
<string name="playlist_leave_confirm">Sair de %1$s? Você deixará de ser colaborador e não poderá adicionar nem remover músicas. Para entrar de novo, você precisará de um novo link de convite.</string>
<string name="playlist_leave_button">Sair</string>
diff --git a/base/app/src/main/res/values-ru/myspoti_strings.xml b/base/app/src/main/res/values-ru/myspoti_strings.xml
index 0af7044e..1f0635e8 100644
--- a/base/app/src/main/res/values-ru/myspoti_strings.xml
+++ b/base/app/src/main/res/values-ru/myspoti_strings.xml
@@ -540,7 +540,7 @@
<string name="song_unavailable_skipped">Трек «%1$s» недоступен и был пропущен.</string>
<string name="song_unavailable">Трек «%1$s» недоступен.</string>
<string name="songs_skipped_by_spotify">Spotify продолжал пропускать треки, которые не смог воспроизвести, поэтому воспроизведение приостановлено. Нажмите «Воспроизвести», чтобы повторить, или проверьте аккаунт и подключение.</string>
- <string name="licences_refused_by_spotify">Spotify пока отказывается воспроизводить треки на этом аккаунте (лицензия отклонена), поэтому воспроизведение приостановлено. Нажмите «Воспроизвести», чтобы повторить позже.</string>
+ <string name="licences_refused_by_spotify">Spotify пока отказывается воспроизводить треки на этом аккаунте (аудиолицензия отклонена), поэтому воспроизведение приостановлено. Немного подождите и нажмите «Воспроизвести», чтобы повторить, и проверьте, работает ли аккаунт в официальном приложении Spotify.</string>
<string name="playlist_member_listener">Слушатель</string>
<string name="playlist_member_remove_collab">Убрать из соавторов</string>
<string name="playlist_member_make_collab">Сделать соавтором</string>
diff --git a/base/app/src/main/res/values-zh/myspoti_strings.xml b/base/app/src/main/res/values-zh/myspoti_strings.xml
index 3717d189..76d4a577 100644
--- a/base/app/src/main/res/values-zh/myspoti_strings.xml
+++ b/base/app/src/main/res/values-zh/myspoti_strings.xml
@@ -531,7 +531,7 @@
<string name="song_unavailable_skipped">%1$s 不可用,已跳过。</string>
<string name="song_unavailable">%1$s 不可用。</string>
<string name="songs_skipped_by_spotify">Spotify 不断跳过无法播放的歌曲,因此播放已暂停。点按播放重试,或检查你的账号和网络连接。</string>
- <string name="licences_refused_by_spotify">Spotify 暂时拒绝在此账号上播放歌曲(许可被拒绝),因此播放已暂停。请稍后点按播放重试。</string>
+ <string name="licences_refused_by_spotify">Spotify 暂时拒绝在此账号上播放歌曲(音频许可被拒绝),因此播放已暂停。请稍等片刻后点按播放重试,并检查该账号能否在官方 Spotify 应用中正常播放。</string>
<string name="playlist_member_listener">听众</string>
<string name="playlist_member_remove_collab">取消协作者身份</string>
<string name="playlist_member_make_collab">设为协作者</string>
diff --git a/base/app/src/main/res/values/myspoti_strings.xml b/base/app/src/main/res/values/myspoti_strings.xml
index 487cacf5..cbbc7654 100644
--- a/base/app/src/main/res/values/myspoti_strings.xml
+++ b/base/app/src/main/res/values/myspoti_strings.xml
@@ -455,7 +455,7 @@
<string name="song_unavailable_skipped">%1$s is unavailable and was skipped.</string>
<string name="song_unavailable">%1$s is unavailable.</string>
<string name="songs_skipped_by_spotify">Spotify kept skipping songs it could not play, so playback was paused. Tap play to try again, or check your account and connection.</string>
- <string name="licences_refused_by_spotify">Spotify is refusing to play songs on this account for now (licence refused), so playback was paused. Tap play to try again later.</string>
+ <string name="licences_refused_by_spotify">Spotify is refusing to play songs on this account right now (audio licence refused), so playback was paused. Wait a while and tap play to try again, and check that the account plays in the official Spotify app.</string>
<string name="spotify_limited">Spotify is limiting playback for a moment. Try again in a minute.</string>
<string name="library_change_undone">Spotify refused the change, your library is back as it was</string>
<string name="blend_title">Blend</string>