v2.54.3 — Dead-Code-Bereinigung (code-review-graph): 7 ungenutzte DB-Methoden entfernt
This commit is contained in:
@@ -182,12 +182,6 @@ class DbHelper {
|
||||
);
|
||||
}
|
||||
|
||||
/// Löscht fehlerhafte Einträge ohne Dateipfad
|
||||
Future<void> alteDummiesLoeschen() async {
|
||||
final d = await db;
|
||||
await d.delete('songs', where: "datei_pfad = '' OR datei_pfad IS NULL");
|
||||
}
|
||||
|
||||
/// Einzelnen Song löschen
|
||||
Future<void> loeschSong(int id) async {
|
||||
final d = await db;
|
||||
@@ -284,12 +278,6 @@ class DbHelper {
|
||||
return rows;
|
||||
}
|
||||
|
||||
/// Löscht die komplette Abspiel-Historie (für "Alle Daten löschen")
|
||||
Future<void> abspielHistorieLoeschen() async {
|
||||
final d = await db;
|
||||
await d.delete('abspiel_historie');
|
||||
}
|
||||
|
||||
/// Markiert einen Song als korrupt
|
||||
Future<void> alsKorruptMarkieren(int songId) async {
|
||||
final d = await db;
|
||||
@@ -297,13 +285,6 @@ class DbHelper {
|
||||
where: 'id = ?', whereArgs: [songId]);
|
||||
}
|
||||
|
||||
/// Markiert einen Song als nicht-korrupt (Reparatur)
|
||||
Future<void> korruptZuruecksetzen(int songId) async {
|
||||
final d = await db;
|
||||
await d.update('songs', {'ist_korrupt': 0},
|
||||
where: 'id = ?', whereArgs: [songId]);
|
||||
}
|
||||
|
||||
/// Alle als korrupt markierten Songs abrufen
|
||||
Future<List<Song>> korrupteSongs() async {
|
||||
final d = await db;
|
||||
@@ -363,27 +344,6 @@ class DbHelper {
|
||||
whereArgs: [songId, tagId]);
|
||||
}
|
||||
|
||||
Future<List<int>> songIdsFuerTag(String tagName) async {
|
||||
final d = await db;
|
||||
final rows = await d.rawQuery('''
|
||||
SELECT st.song_id FROM song_tags st
|
||||
JOIN tags t ON t.id = st.tag_id
|
||||
WHERE t.name = ?
|
||||
''', [tagName]);
|
||||
return rows.map((r) => r['song_id'] as int).toList();
|
||||
}
|
||||
|
||||
Future<Map<String, int>> tagCountsBerechnen() async {
|
||||
final d = await db;
|
||||
final rows = await d.rawQuery('''
|
||||
SELECT t.name, COUNT(st.song_id) as cnt
|
||||
FROM tags t
|
||||
LEFT JOIN song_tags st ON t.id = st.tag_id
|
||||
GROUP BY t.name
|
||||
''');
|
||||
return {for (final r in rows) r['name'] as String: r['cnt'] as int};
|
||||
}
|
||||
|
||||
// ─── Playlists ───────────────────────────────────
|
||||
|
||||
Future<int> playlistErstellen(String name) async {
|
||||
@@ -466,15 +426,6 @@ class DbHelper {
|
||||
await d.update('songs', update, where: 'id = ?', whereArgs: [songId]);
|
||||
}
|
||||
|
||||
/// Sync-Metadaten lesen
|
||||
Future<String?> syncMetaGet(String key) async {
|
||||
final d = await db;
|
||||
final rows = await d.query('sync_metadata',
|
||||
where: 'key = ?', whereArgs: [key]);
|
||||
if (rows.isEmpty) return null;
|
||||
return rows.first['value'] as String?;
|
||||
}
|
||||
|
||||
/// Sync-Metadaten setzen
|
||||
Future<void> syncMetaSet(String key, String value) async {
|
||||
final d = await db;
|
||||
@@ -482,13 +433,6 @@ class DbHelper {
|
||||
conflictAlgorithm: ConflictAlgorithm.replace);
|
||||
}
|
||||
|
||||
/// Server-Favoriten abrufen (alle cloud_ids)
|
||||
Future<Set<String>> serverFavoritesGet() async {
|
||||
final d = await db;
|
||||
final rows = await d.query('server_favorites');
|
||||
return rows.map((r) => r['cloud_id'] as String).toSet();
|
||||
}
|
||||
|
||||
/// Server-Favoriten ersetzen (komplette Liste)
|
||||
Future<void> serverFavoritesSet(List<String> cloudIds) async {
|
||||
final d = await db;
|
||||
|
||||
Reference in New Issue
Block a user