feat: migrate downloads to background_downloader

close #454
This commit is contained in:
edde746
2026-02-14 18:02:49 +01:00
parent 2278af8d83
commit d986f0d2ea
10 changed files with 1762 additions and 880 deletions
+5 -2
View File
@@ -16,7 +16,7 @@ class AppDatabase extends _$AppDatabase {
AppDatabase() : super(_openConnection());
@override
int get schemaVersion => 7; // Added OfflineWatchProgress table
int get schemaVersion => 8; // Added bgTaskId column to DownloadedMedia
@override
MigrationStrategy get migration {
@@ -25,11 +25,14 @@ class AppDatabase extends _$AppDatabase {
await m.createAll();
},
onUpgrade: (Migrator m, int from, int to) async {
// Additive migration for schema version 7
if (from < 7) {
appLogger.i('Adding OfflineWatchProgress table (v7 migration)');
await m.createTable(offlineWatchProgress);
}
if (from < 8) {
appLogger.i('Adding bgTaskId column to DownloadedMedia (v8 migration)');
await m.addColumn(downloadedMedia, downloadedMedia.bgTaskId);
}
},
);
}