Skip to content

Commit 54ae983

Browse files
committed
feat: add auto-skip unavailable tracks option for queue playback
- Add autoSkipUnavailableTracks setting (default: on) to skip to next queue item when stream resolution fails instead of stopping playback - Extract _handleQueueItemPlaybackFailure to centralize resolve error handling and auto-skip logic - Wrap prefetched stream re-resolve in try/catch to handle secondary failures gracefully - Add settings toggle UI with localized strings for EN, ID, and all supported languages
1 parent 48ffc5e commit 54ae983

21 files changed

+312
-24
lines changed

lib/l10n/app_localizations.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,24 @@ abstract class AppLocalizations {
544544
/// **'Try other services if download fails'**
545545
String get optionsAutoFallbackSubtitle;
546546

547+
/// Toggle to skip to the next queue track when current track stream resolution fails
548+
///
549+
/// In en, this message translates to:
550+
/// **'Auto Skip Unavailable Tracks'**
551+
String get optionsAutoSkipUnavailableTracks;
552+
553+
/// Subtitle when auto skip on resolve failure is enabled
554+
///
555+
/// In en, this message translates to:
556+
/// **'Automatically skip to the next queue track when a stream cannot be resolved.'**
557+
String get optionsAutoSkipUnavailableTracksSubtitleOn;
558+
559+
/// Subtitle when auto skip on resolve failure is disabled
560+
///
561+
/// In en, this message translates to:
562+
/// **'Stop on failed track resolution and show an error.'**
563+
String get optionsAutoSkipUnavailableTracksSubtitleOff;
564+
547565
/// Tap behavior mode for track lists
548566
///
549567
/// In en, this message translates to:

lib/l10n/app_localizations_de.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,17 @@ class AppLocalizationsDe extends AppLocalizations {
251251
String get optionsAutoFallbackSubtitle =>
252252
'Andere Dienste versuchen, wenn Download fehlschlägt';
253253

254+
@override
255+
String get optionsAutoSkipUnavailableTracks => 'Auto Skip Unavailable Tracks';
256+
257+
@override
258+
String get optionsAutoSkipUnavailableTracksSubtitleOn =>
259+
'Automatically skip to the next queue track when a stream cannot be resolved.';
260+
261+
@override
262+
String get optionsAutoSkipUnavailableTracksSubtitleOff =>
263+
'Stop on failed track resolution and show an error.';
264+
254265
@override
255266
String get optionsInteractionMode => 'Interaction Mode';
256267

lib/l10n/app_localizations_en.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,17 @@ class AppLocalizationsEn extends AppLocalizations {
248248
String get optionsAutoFallbackSubtitle =>
249249
'Try other services if download fails';
250250

251+
@override
252+
String get optionsAutoSkipUnavailableTracks => 'Auto Skip Unavailable Tracks';
253+
254+
@override
255+
String get optionsAutoSkipUnavailableTracksSubtitleOn =>
256+
'Automatically skip to the next queue track when a stream cannot be resolved.';
257+
258+
@override
259+
String get optionsAutoSkipUnavailableTracksSubtitleOff =>
260+
'Stop on failed track resolution and show an error.';
261+
251262
@override
252263
String get optionsInteractionMode => 'Interaction Mode';
253264

lib/l10n/app_localizations_es.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,17 @@ class AppLocalizationsEs extends AppLocalizations {
248248
String get optionsAutoFallbackSubtitle =>
249249
'Try other services if download fails';
250250

251+
@override
252+
String get optionsAutoSkipUnavailableTracks => 'Auto Skip Unavailable Tracks';
253+
254+
@override
255+
String get optionsAutoSkipUnavailableTracksSubtitleOn =>
256+
'Automatically skip to the next queue track when a stream cannot be resolved.';
257+
258+
@override
259+
String get optionsAutoSkipUnavailableTracksSubtitleOff =>
260+
'Stop on failed track resolution and show an error.';
261+
251262
@override
252263
String get optionsInteractionMode => 'Interaction Mode';
253264

lib/l10n/app_localizations_fr.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,17 @@ class AppLocalizationsFr extends AppLocalizations {
253253
String get optionsAutoFallbackSubtitle =>
254254
'Essayez d\'autres services si le téléchargement échoue';
255255

256+
@override
257+
String get optionsAutoSkipUnavailableTracks => 'Auto Skip Unavailable Tracks';
258+
259+
@override
260+
String get optionsAutoSkipUnavailableTracksSubtitleOn =>
261+
'Automatically skip to the next queue track when a stream cannot be resolved.';
262+
263+
@override
264+
String get optionsAutoSkipUnavailableTracksSubtitleOff =>
265+
'Stop on failed track resolution and show an error.';
266+
256267
@override
257268
String get optionsInteractionMode => 'Interaction Mode';
258269

lib/l10n/app_localizations_hi.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,17 @@ class AppLocalizationsHi extends AppLocalizations {
248248
String get optionsAutoFallbackSubtitle =>
249249
'Try other services if download fails';
250250

251+
@override
252+
String get optionsAutoSkipUnavailableTracks => 'Auto Skip Unavailable Tracks';
253+
254+
@override
255+
String get optionsAutoSkipUnavailableTracksSubtitleOn =>
256+
'Automatically skip to the next queue track when a stream cannot be resolved.';
257+
258+
@override
259+
String get optionsAutoSkipUnavailableTracksSubtitleOff =>
260+
'Stop on failed track resolution and show an error.';
261+
251262
@override
252263
String get optionsInteractionMode => 'Interaction Mode';
253264

lib/l10n/app_localizations_id.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,18 @@ class AppLocalizationsId extends AppLocalizations {
251251
String get optionsAutoFallbackSubtitle =>
252252
'Coba layanan lain jika unduhan gagal';
253253

254+
@override
255+
String get optionsAutoSkipUnavailableTracks =>
256+
'Lewati Otomatis Lagu yang Tidak Tersedia';
257+
258+
@override
259+
String get optionsAutoSkipUnavailableTracksSubtitleOn =>
260+
'Otomatis lanjut ke lagu berikutnya di antrean jika stream lagu tidak bisa ditemukan.';
261+
262+
@override
263+
String get optionsAutoSkipUnavailableTracksSubtitleOff =>
264+
'Berhenti di lagu yang gagal dan tampilkan pesan error.';
265+
254266
@override
255267
String get optionsInteractionMode => 'Mode Interaksi';
256268

lib/l10n/app_localizations_ja.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,17 @@ class AppLocalizationsJa extends AppLocalizations {
248248
String get optionsAutoFallbackSubtitle =>
249249
'Try other services if download fails';
250250

251+
@override
252+
String get optionsAutoSkipUnavailableTracks => 'Auto Skip Unavailable Tracks';
253+
254+
@override
255+
String get optionsAutoSkipUnavailableTracksSubtitleOn =>
256+
'Automatically skip to the next queue track when a stream cannot be resolved.';
257+
258+
@override
259+
String get optionsAutoSkipUnavailableTracksSubtitleOff =>
260+
'Stop on failed track resolution and show an error.';
261+
251262
@override
252263
String get optionsInteractionMode => 'Interaction Mode';
253264

lib/l10n/app_localizations_ko.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,17 @@ class AppLocalizationsKo extends AppLocalizations {
247247
@override
248248
String get optionsAutoFallbackSubtitle => '다운로드가 실패한 경우, 다른 서비스로 재시도';
249249

250+
@override
251+
String get optionsAutoSkipUnavailableTracks => 'Auto Skip Unavailable Tracks';
252+
253+
@override
254+
String get optionsAutoSkipUnavailableTracksSubtitleOn =>
255+
'Automatically skip to the next queue track when a stream cannot be resolved.';
256+
257+
@override
258+
String get optionsAutoSkipUnavailableTracksSubtitleOff =>
259+
'Stop on failed track resolution and show an error.';
260+
250261
@override
251262
String get optionsInteractionMode => 'Interaction Mode';
252263

lib/l10n/app_localizations_nl.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,17 @@ class AppLocalizationsNl extends AppLocalizations {
248248
String get optionsAutoFallbackSubtitle =>
249249
'Try other services if download fails';
250250

251+
@override
252+
String get optionsAutoSkipUnavailableTracks => 'Auto Skip Unavailable Tracks';
253+
254+
@override
255+
String get optionsAutoSkipUnavailableTracksSubtitleOn =>
256+
'Automatically skip to the next queue track when a stream cannot be resolved.';
257+
258+
@override
259+
String get optionsAutoSkipUnavailableTracksSubtitleOff =>
260+
'Stop on failed track resolution and show an error.';
261+
251262
@override
252263
String get optionsInteractionMode => 'Interaction Mode';
253264

0 commit comments

Comments
 (0)