Skip to content

Commit

Permalink
Accouunt for deprecation of GameData.path() in DB
Browse files Browse the repository at this point in the history
  • Loading branch information
oblivioncth committed Jun 28, 2024
1 parent 28f476b commit b558993
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/include/fp/fp-toolkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class FP_FP_EXPORT Toolkit
//-Class Functions-----------------------------------------------------------------------------------------------
private:
static QString standardImageSubPath(QUuid gameId);
static QString datapackFilename(const Fp::GameData& gameData);

public:
static Qx::Error appInvolvesSecurePlayer(bool& involvesBuffer, QFileInfo appInfo);
Expand Down
6 changes: 4 additions & 2 deletions lib/src/fp-toolkit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ QString Toolkit::standardImageSubPath(QUuid gameId)
return gameIdString.left(2) + '/' + gameIdString.mid(2, 2) + '/' + gameIdString;
}

static QString datapackFilename(const Fp::GameData& gameData) { return gameData.gameId().toString(QUuid::WithoutBraces) + '-' + QString::number(gameData.dateAdded().toMSecsSinceEpoch()) + u".zip"_s; }

//Public:
Qx::Error Toolkit::appInvolvesSecurePlayer(bool& involvesBuffer, QFileInfo appInfo)
{
Expand Down Expand Up @@ -185,9 +187,9 @@ bool Toolkit::resolveTrueAppPath(QString& appPath, const QString& platform, QHas
return swapped;
}

QString Toolkit::datapackPath(const Fp::GameData& gameData) const { return mDatapackLocalDir.absoluteFilePath(gameData.path()); }
QString Toolkit::datapackPath(const Fp::GameData& gameData) const { return mDatapackLocalDir.absoluteFilePath(datapackFilename(gameData)); }

QUrl Toolkit::datapackUrl(const Fp::GameData& gameData) const { return mDatapackRemoteBase + '/' + gameData.path(); }
QUrl Toolkit::datapackUrl(const Fp::GameData& gameData) const { return mDatapackRemoteBase + '/' + datapackFilename(gameData); }

bool Toolkit::datapackIsPresent(const Fp::GameData& gameData) const
{
Expand Down

0 comments on commit b558993

Please sign in to comment.