diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/buildmavericks/repository/MavericksRepository.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/buildmavericks/repository/MavericksRepository.java index 4243595b0..5d36366e7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/buildmavericks/repository/MavericksRepository.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/buildmavericks/repository/MavericksRepository.java @@ -93,7 +93,7 @@ public class MavericksRepository try (Connection conn = DBPool.getAccount().getConnection()) { String filter = onlyUnreviewed ? "WHERE Reviewed=0 " : ""; - PreparedStatement stmt = conn.prepareStatement("SELECT (SELECT uuid FROM accounts WHERE accounts.id=mavericksMasterBuildersBuilds.accountId),BuildTheme,Points,Place,Date,Schematic FROM mavericksMasterBuildersBuilds " + filter + " ORDER BY Points LIMIT " + limit + " OFFSET " + offset); + PreparedStatement stmt = conn.prepareStatement("SELECT (SELECT uuid FROM accounts WHERE accounts.id=" + TABLE + ".accountId),BuildTheme,Points,Place,Date,Schematic FROM " + TABLE + " " + filter + " ORDER BY Points LIMIT " + limit + " OFFSET " + offset); ResultSet set = stmt.executeQuery(); List list = new ArrayList<>(); @@ -115,5 +115,25 @@ public class MavericksRepository } }); } + + public CompletableFuture setReviewed(long dateStamp, boolean reviewed) + { + return CompletableFuture.supplyAsync(() -> + { + try (Connection conn = DBPool.getAccount().getConnection()) + { + + PreparedStatement stmt = conn.prepareStatement("UPDATE " + TABLE + " SET Reviewed=? WHERE Date=?"); + stmt.setInt(1, reviewed? 1 : 0); + stmt.setLong(2, dateStamp); + + return stmt.executeUpdate() > 0; + } + catch(SQLException e) + { + throw new RuntimeException(e); + } + }); + } }