[Server] Move replay access reads and writes into the database interface

cmdReplayList, cmdReplayDownload, cmdReplayModifyMatch and cmdReplayDeleteMatch issued their own SQL through Servatrice_DatabaseInterface. Add ReplayMatchRecord/ReplayEntry and the ReplayAccessResult/ReplayWriteResult enums to Server_DatabaseInterface, implement the list, data, do-not-hide and delete operations with the same statements and response mapping, and let the commands ask the injected interface. checkSql stays in the two write commands where it already was.
This commit is contained in:
Lukas Brübach 2026-11-09 22:11:23 +01:00
parent 653f7f0ef9
commit a5e259fece
4 changed files with 196 additions and 78 deletions

View file

@ -158,6 +158,10 @@ public:
bool getDeckShareItem(const QString &token, int itemId, QString &content) override;
/** @brief Id and color identity of every deck file in a folder, for the share builder. */
bool getDeckFilesInFolder(int folderId, int userId, QList<DeckFileListItem> &files) override;
QList<ReplayMatchRecord> getReplayList(int userId) override;
ReplayAccessResult getReplayData(int replayId, int userId, QByteArray &data) override;
ReplayWriteResult setReplayDoNotHide(int gameId, int userId, bool doNotHide) override;
ReplayWriteResult deleteReplayAccess(int gameId, int userId) override;
/** @brief Deletes all expired share bundles (cascades to their items). */
void cleanupExpiredDeckShares();