fix: code-review #2 — dedup MagicBytes, auth für check_corrupted, UI-Flag, merged player streams, jq-JSON

This commit is contained in:
Dustin
2026-08-01 16:48:45 +02:00
parent 2d4c7c8b98
commit f00fd445f5
5 changed files with 57 additions and 90 deletions
+5 -3
View File
@@ -27,6 +27,7 @@ class _CloudScreenState extends State<CloudScreen> {
String _letzterSync = 'Nie';
List<Map> _korrupteSongs = [];
bool _ladtKorrupt = false;
bool _hatGeprueft = false;
@override
void initState() {
@@ -94,12 +95,13 @@ class _CloudScreenState extends State<CloudScreen> {
}
Future<void> _ladeKorrupteSongs() async {
setState(() => _ladtKorrupt = true);
setState(() { _ladtKorrupt = true; _hatGeprueft = false; });
try {
final corrupted = await widget.cloud.getCorrupted();
if (mounted) setState(() => _korrupteSongs = corrupted);
if (mounted) setState(() { _korrupteSongs = corrupted; _hatGeprueft = true; });
} catch (e) {
MeloLogger().fehler('cloud_corrupted_laden', e);
if (mounted) setState(() => _hatGeprueft = true);
} finally {
if (mounted) setState(() => _ladtKorrupt = false);
}
@@ -598,7 +600,7 @@ class _CloudScreenState extends State<CloudScreen> {
],
),
)),
] else if (!_ladtKorrupt && _korrupteSongs.isEmpty)
] else if (!_ladtKorrupt && _hatGeprueft && _korrupteSongs.isEmpty)
const Padding(
padding: EdgeInsets.only(top: 8),
child: Text(