Kategorien (mehrere je Song), Metadaten-Ansicht mit Expertenmodus
- DB-Schema 4: Tabelle song_categories + Spalte categories_edited - Kategorien kommen aus dem Genre-Tag (Trennung an ; , | /), manuell bearbeitbar; von Hand gesetzte Kategorien ueberlebt der naechste Scan - Songzeile zeigt "Kuenstler | Kategorie1 - Kategorie2" - Einstellung "Gleiche Kategorie = gleiches Coverbild" (Standard an) - Metadaten-Sheet mit ausklappbarem Expertenmodus - Neu: categories.dart, category_service.dart, song_detail_sheet.dart, app_settings.dart Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011snPXPafPC5i87o68H14W7
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:path/path.dart' as p;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
import 'categories.dart';
|
||||
import 'database.dart';
|
||||
|
||||
const _uuid = Uuid();
|
||||
@@ -34,6 +35,8 @@ Future<int> scanAndroidMediaStore(
|
||||
|
||||
final now = DateTime.now().millisecondsSinceEpoch;
|
||||
final companions = <SongsCompanion>[];
|
||||
// Siehe scan_service.dart: erst Songs, dann Kategorien.
|
||||
final categories = <String, List<String>>{};
|
||||
var done = 0;
|
||||
|
||||
if (songs.isNotEmpty) onProgress?.call(0, songs.length);
|
||||
@@ -69,6 +72,9 @@ Future<int> scanAndroidMediaStore(
|
||||
updatedAtMs: now,
|
||||
deleted: const Value(false),
|
||||
));
|
||||
if (prev?.categoriesEdited != true) {
|
||||
categories[id] = parseCategories(s.genre);
|
||||
}
|
||||
++done;
|
||||
if (done % 50 == 0 || done == songs.length) {
|
||||
onProgress?.call(done, songs.length);
|
||||
@@ -76,6 +82,9 @@ Future<int> scanAndroidMediaStore(
|
||||
}
|
||||
|
||||
await db.upsertSongs(companions);
|
||||
for (final entry in categories.entries) {
|
||||
await db.setCategories(entry.key, entry.value);
|
||||
}
|
||||
if (companions.isNotEmpty) {
|
||||
await db.markMissing(now);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user