chore: clean up code comments

This commit is contained in:
edde746
2026-08-10 20:28:41 +02:00
parent 5611c6785a
commit 69fadc220d
170 changed files with 324 additions and 1765 deletions
-27
View File
@@ -61,10 +61,6 @@ class _AppDatabaseTestSuite {
}
void _registerSchemaTests() {
// ============================================================
// Schema sanity
// ============================================================
group('schema', () {
test('all tables are accessible and start empty', () async {
expect(await db.select(db.downloadedMedia).get(), isEmpty);
@@ -936,13 +932,6 @@ class _AppDatabaseTestSuite {
}
void _registerLegacyDesktopMigrationTests() {
// ============================================================
// Legacy desktop DB-file relocation (Documents → AppSupport).
// Regression coverage for #1022: cross-drive rename (e.g. OneDrive
// Documents on X:, AppData on C:) used to throw an uncaught
// FileSystemException out of _openConnection and strand the splash.
// ============================================================
group('legacy desktop DB migration', () {
late Directory tempDir;
@@ -1133,10 +1122,6 @@ class _AppDatabaseTestSuite {
}
void _registerApiCacheTests() {
// ============================================================
// ApiCache schema defaults and constraints
// ============================================================
group('ApiCache', () {
test('default pinned=false, custom pinned=true is honored', () async {
await db.into(db.apiCache).insert(ApiCacheCompanion.insert(cacheKey: 'k1', data: 'a'));
@@ -1159,10 +1144,6 @@ class _AppDatabaseTestSuite {
}
void _registerDownloadedMediaTests() {
// ============================================================
// DownloadedMedia: persistence, defaults, constraints, and helpers
// ============================================================
group('DownloadedMedia', () {
Future<int> insertMovie({
String serverId = 'srv1',
@@ -1471,10 +1452,6 @@ class _AppDatabaseTestSuite {
}
void _registerOfflineWatchProgressTests() {
// ============================================================
// OfflineWatchProgress helpers
// ============================================================
group('OfflineWatchProgress', () {
Future<int> insertAction({
String serverId = 's',
@@ -2080,10 +2057,6 @@ class _AppDatabaseTestSuite {
}
void _registerSyncRulesTests() {
// ============================================================
// Sync Rules helpers
// ============================================================
group('SyncRules', () {
test('insertSyncRule + getSyncRules round-trip with defaults', () async {
await db.insertSyncRule(
+1 -26
View File
@@ -333,10 +333,6 @@ void main() {
});
});
// ============================================================
// Download queue + getNextQueueItem
// ============================================================
group('queue', () {
test('addToQueue inserts a row with defaults', () async {
await db.addToQueue(mediaGlobalKey: 'srv:100');
@@ -383,7 +379,6 @@ void main() {
});
test('getNextQueueItem only returns items whose media is queued', () async {
// Two items in queue; one's media is still queued, the other is downloading.
await db.insertDownload(
serverId: ServerId('srv'),
ratingKey: '1',
@@ -404,12 +399,10 @@ void main() {
final next = await db.getNextQueueItem();
expect(next, isNotNull);
// Should pick srv:1 since srv:2 is downloading (not queued).
expect(next!.mediaGlobalKey, 'srv:1');
});
test('getNextQueueItem orders by priority desc, then addedAt asc', () async {
// All have queued status
await db.insertDownload(
serverId: ServerId('srv'),
ratingKey: '1',
@@ -445,7 +438,6 @@ void main() {
.insert(DownloadQueueCompanion.insert(mediaGlobalKey: 'srv:3', priority: const Value(5), addedAt: now + 50));
final next = await db.getNextQueueItem();
// priority 5 wins; srv:3 added before srv:2.
expect(next!.mediaGlobalKey, 'srv:3');
});
@@ -537,10 +529,6 @@ void main() {
});
});
// ============================================================
// Update helpers
// ============================================================
group('update helpers', () {
Future<void> seed({String key = 'srv:100'}) async {
await db.insertDownload(
@@ -558,7 +546,7 @@ void main() {
final r = (await db.select(db.downloadedMedia).get()).single;
expect(r.status, DownloadStatus.downloading.index);
expect(r.progress, 0); // untouched
expect(r.progress, 0);
});
test('updateDownloadProgress writes progress + bytes', () async {
@@ -652,10 +640,6 @@ void main() {
});
});
// ============================================================
// Lookup helpers
// ============================================================
group('lookup helpers', () {
Future<void> seedTree() async {
await db.insertDownload(
@@ -885,10 +869,6 @@ void main() {
});
});
// ============================================================
// Download owners
// ============================================================
group('download owners', () {
Future<void> insertProfile(String id) async {
await db
@@ -964,10 +944,6 @@ void main() {
});
});
// ============================================================
// deleteDownload — removes from both tables
// ============================================================
group('deleteDownload', () {
test('removes the row from downloadedMedia AND its queue entry', () async {
await db.insertDownload(
@@ -999,7 +975,6 @@ void main() {
});
test('deleteDownload on a missing globalKey is a no-op', () async {
// Should not throw.
expect(await db.deleteDownload('nope:nope'), isNull);
expect(await db.select(db.downloadedMedia).get(), isEmpty);
expect(await db.select(db.downloadQueue).get(), isEmpty);