v2.52.1 — F2: YT-Links nur als Server-Fallback

## YT-Quell-URL (Server ist die Quelle)
- cloud_service.ytUrlSetzen(): POST /api/v1/cloud/yt-url (per-User UPDATE user_songs.yt_url)
- musik_scanner._sucheYtUrls(): durchsucht NUR Songs mit cloud_id, die auf dem Server noch keine yt_url haben; Treffer werden auf den Server hochgeladen statt lokal gespeichert
- db_helper: ytUrlAktualisieren/songsOhneYtUrl entfernt, songsMitCloudId() ergänzt
- download_service: yt_url wird beim Download nicht mehr lokal persistiert

## Fallback-Kette reDownload (korrupte/fehlende Datei)
- 1) Server-Download via cloud_id + Magic-Byte-Check (primäre Quelle)
- 2) Server-ytUrl (aus listSongs) → yt-proxy als letzte Chance
- 3) Legacy: lokal gespeicherte ytUrl (Bestandsdaten vor v2.52)
- song_tile: „Neu laden“ erscheint bei istKorrupt && (cloudId != null || ytUrl != null)
- 3 neue Tests (ytUrlSetzen: ok/error/401) → 111 Tests grün, analyze 0 Issues
This commit is contained in:
Dustin
2026-08-05 10:40:37 +02:00
parent 3b898e238e
commit bf0f544e4b
6 changed files with 158 additions and 35 deletions
+13
View File
@@ -274,6 +274,19 @@ class CloudService extends ChangeNotifier {
return r?['status'] == 'ok';
}
// ─── 🎬 YouTube-Quell-URL (Server-Fallback) ───
/// YT-Quell-URL eines Songs auf dem Server setzen (F2: Der Server ist die
/// Quelle für YT-Links — die App speichert `yt_url` nicht mehr lokal,
/// sondern lädt gefundene Treffer per Endpoint hoch).
Future<bool> ytUrlSetzen(String songId, String ytUrl) async {
final r = await _post('/api/v1/cloud/yt-url', {
'song_id': songId,
'yt_url': ytUrl,
});
return r?['status'] == 'ok';
}
// ─── ✏️ Umbenennen ───
/// Song umbenennen (benutzerdefinierter Titel/Artist)