Lyrics offset

This commit is contained in:
2025-12-16 22:35:43 +08:00
parent ac78ac002b
commit da71c31e2a
5 changed files with 377 additions and 192 deletions

View File

@@ -12,6 +12,9 @@ class Tracks extends Table {
TextColumn get path => text().unique()();
TextColumn get artUri => text().nullable()(); // Path to local cover art
TextColumn get lyrics => text().nullable()(); // JSON formatted lyrics
IntColumn get lyricsOffset => integer().withDefault(
const Constant(0),
)(); // Offset in milliseconds for lyrics timing
DateTimeColumn get addedAt => dateTime().withDefault(currentDateAndTime)();
}
@@ -34,7 +37,7 @@ class AppDatabase extends _$AppDatabase {
AppDatabase() : super(_openConnection());
@override
int get schemaVersion => 4; // Bump version for lyrics column
int get schemaVersion => 5; // Bump version for lyricsOffset column
@override
MigrationStrategy get migration {
@@ -53,6 +56,9 @@ class AppDatabase extends _$AppDatabase {
if (from < 4) {
await m.addColumn(tracks, tracks.lyrics);
}
if (from < 5) {
await m.addColumn(tracks, tracks.lyricsOffset);
}
},
);
}