Skip to content

Commit

Permalink
Handle playlist games with missing IDs
Browse files Browse the repository at this point in the history
Namely Favorites.
  • Loading branch information
oblivioncth committed Aug 12, 2023
1 parent 9650445 commit 0d73e74
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ set(LIBFP_QX_COMPONENTS

include(OB/FetchQx)
ob_fetch_qx(
REF "87475b929b645665f92bdb0f6551aa63887c791f"
REF "6608e0a92d667846333c2349344771eb3c1a1c60"
COMPONENTS
${LIBFP_QX_COMPONENTS}
)
Expand Down
6 changes: 3 additions & 3 deletions lib/include/fp/fp-items.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class FP_FP_EXPORT PlaylistGame

//-Instance Variables-----------------------------------------------------------------------------------------------
private:
int mId;
std::optional<int> mId;
QUuid mPlaylistId;
int mOrder;
QUuid mGameId;
Expand All @@ -318,7 +318,7 @@ class FP_FP_EXPORT PlaylistGame

//-Instance Functions------------------------------------------------------------------------------------------------------
public:
int id() const;
std::optional<int> id() const;
QUuid playlistId() const;
int order() const;
QUuid gameId() const;
Expand All @@ -336,7 +336,7 @@ class FP_FP_EXPORT PlaylistGame::Builder

//-Instance Functions------------------------------------------------------------------------------------------
public:
Builder& wId(int id);
Builder& wId(std::optional<int> id);
Builder& wPlaylistId(QStringView rawPlaylistId);
Builder& wOrder(int order);
Builder& wGameId(QStringView rawGameId);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/fp-items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ PlaylistGame::PlaylistGame() {}
//-Instance Functions------------------------------------------------------------------------------------------------
//Public:

int PlaylistGame::id() const { return mId; }
std::optional<int> PlaylistGame::id() const { return mId; }
QUuid PlaylistGame::playlistId() const { return mPlaylistId; }
int PlaylistGame::order() const { return mOrder; }
QUuid PlaylistGame::gameId() const { return mGameId; }
Expand All @@ -269,7 +269,7 @@ PlaylistGame::Builder::Builder() {}

//-Instance Functions------------------------------------------------------------------------------------------
//Public:
PlaylistGame::Builder& PlaylistGame::Builder::wId(int id) { mPlaylistGameBlueprint.mId = id; return *this; }
PlaylistGame::Builder& PlaylistGame::Builder::wId(std::optional<int> id) { mPlaylistGameBlueprint.mId = id; return *this; }
PlaylistGame::Builder& PlaylistGame::Builder::wPlaylistId(QStringView rawPlaylistId) { mPlaylistGameBlueprint.mPlaylistId = QUuid(rawPlaylistId); return *this; }
PlaylistGame::Builder& PlaylistGame::Builder::wOrder(int order) { mPlaylistGameBlueprint.mOrder = order; return *this; }
PlaylistGame::Builder& PlaylistGame::Builder::wGameId(QStringView rawGameId) { mPlaylistGameBlueprint.mGameId = QUuid(rawGameId); return *this; }
Expand Down
2 changes: 1 addition & 1 deletion lib/src/fp-playlistmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Json

struct PlaylistGame
{
int id;
std::optional<int> id;
QString playlistId;
int order;
QString gameId;
Expand Down

0 comments on commit 0d73e74

Please sign in to comment.