From d903a9fd7e87d32270d9cf9847e3f9caba3d0535 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 12 Apr 2026 02:02:16 +0200 Subject: [PATCH] Refactoring --- lib/data/dao/score_dao.dart | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/data/dao/score_dao.dart b/lib/data/dao/score_dao.dart index a973fae..f2fd15c 100644 --- a/lib/data/dao/score_dao.dart +++ b/lib/data/dao/score_dao.dart @@ -49,11 +49,7 @@ class ScoreDao extends DatabaseAccessor with _$ScoreDaoMixin { .toList(); await batch((batch) { - batch.insertAll( - ScoreEntryTable, - entries, - mode: InsertMode.insertOrReplace, - ); + batch.insertAll(scoreTable, entries, mode: InsertMode.insertOrReplace); }); } @@ -185,10 +181,10 @@ class ScoreDao extends DatabaseAccessor with _$ScoreDaoMixin { /// Returns `null` if there are no scores for the match. Future getLatestRoundNumber({required String matchId}) async { final query = selectOnly(scoreEntryTable) - ..where(ScoreEntryTable.matchId.equals(matchId)) - ..addColumns([ScoreEntryTable.roundNumber.max()]); + ..where(scoreEntryTable.matchId.equals(matchId)) + ..addColumns([scoreEntryTable.roundNumber.max()]); final result = await query.getSingle(); - return result.read(ScoreEntryTable.roundNumber.max()); + return result.read(scoreEntryTable.roundNumber.max()); } /// Aggregates the total score for a player in a match by summing all their