[Server] Move replay access reads and writes into the database interface (#7838)

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:
BruebachL 2026-11-10 12:16:24 +01:00 • committed by GitHub
parent ba037cbf04
commit b2e69d3443
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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();