fix: Login-Fehlerhandler — 200 ohne Token abfangen, Server-Nachrichten parsen

This commit is contained in:
Dustin
2026-08-01 17:44:05 +02:00
parent 7f17a5afd6
commit a495a183d8
6 changed files with 122 additions and 7 deletions
+4
View File
@@ -12,6 +12,7 @@ class Song {
final String hinzugefuegtAm;
final String downloadQuelle; // "local", "youtube", "server"
final String? streamUrl; // Für Server-Streaming (Navidrome) wird bewusst NICHT in der DB persistiert (Auth-Token-Schutz)
final String? ytUrl; // YouTube-Quell-URL für Auto-Redownload bei korrupten Songs
int? zuletztPosition; // Sekunden, für Wiederaufnahme
Set<int>? tagIds; // Cache für Tag-Filterung (nicht in DB gespeichert)
@@ -29,6 +30,7 @@ class Song {
String? hinzugefuegtAm,
this.downloadQuelle = 'local',
this.streamUrl,
this.ytUrl,
this.zuletztPosition,
}) : hinzugefuegtAm = hinzugefuegtAm ?? DateTime.now().toIso8601String();
@@ -46,6 +48,7 @@ class Song {
'hinzugefuegt_am': hinzugefuegtAm,
'download_quelle': downloadQuelle,
'stream_url': null, // Token-haltige Stream-URLs nie persistieren (Sicherheit)
'yt_url': ytUrl,
'zuletzt_position': zuletztPosition,
};
@@ -63,6 +66,7 @@ class Song {
hinzugefuegtAm: m['hinzugefuegt_am'] as String?,
downloadQuelle: m['download_quelle'] as String? ?? 'local',
streamUrl: m['stream_url'] as String?,
ytUrl: m['yt_url'] as String?,
zuletztPosition: m['zuletzt_position'] as int?,
);