v2.52.4 — Einstellungen (F4): Auto-Sync-Intervall, Sleep-Timer-Default, Wiedergabegeschwindigkeit, Akzentfarbe, Storage-Info
This commit is contained in:
@@ -535,4 +535,19 @@ class DbHelper {
|
||||
await txn.delete('songs');
|
||||
});
|
||||
}
|
||||
|
||||
/// Speicher-Info für die Einstellungen (F4): Anzahl lokaler Songs +
|
||||
/// belegter Speicher in Bytes (Σ `groesse_bytes`).
|
||||
Future<Map<String, int>> speicherInfo() async {
|
||||
final d = await db;
|
||||
final rows = await d.rawQuery(
|
||||
'SELECT COUNT(*) AS anzahl, COALESCE(SUM(groesse_bytes), 0) AS bytes '
|
||||
'FROM songs');
|
||||
if (rows.isEmpty) return {'anzahl': 0, 'bytes': 0};
|
||||
final erste = rows.first;
|
||||
return {
|
||||
'anzahl': (erste['anzahl'] as num?)?.toInt() ?? 0,
|
||||
'bytes': (erste['bytes'] as num?)?.toInt() ?? 0,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user