Skip to content

Commit

Permalink
(Mostly) implement Game Redirects
Browse files Browse the repository at this point in the history
Taking a shortcut here, see libfp commit for details.
  • Loading branch information
oblivioncth committed Jun 30, 2024
1 parent bfe43c4 commit f060eac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ ob_fetch_qx(

# Fetch libfp (build and import from source)
include(OB/Fetchlibfp)
ob_fetch_libfp("5ff81d39c13e40f7fbfe01e44dc2170648d35dc8")
ob_fetch_libfp("e65151253813b8da7d7f9b8849810f58dd5e9a50")

# Fetch QI-QMP (build and import from source)
include(OB/FetchQI-QMP)
Expand Down
4 changes: 4 additions & 0 deletions app/src/command/c-download.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ Qx::Error CDownload::perform()
const Fp::Toolkit* tk = mCore.fpInstall().toolkit();
for(const auto& pg : pItr->playlistGames())
{
/* TODO: This doesn't handle Game Redirects, i.e. if one ID on a playlist becomes a redirect entry in the future.
* Either need to add redirects here, or implement them in the DB module of libfp (full implementation).
*/

// Get data
Fp::GameData gameData;
if(Fp::DbError gdErr = db->getGameData(gameData, pg.gameId()); gdErr.isValid())
Expand Down
4 changes: 4 additions & 0 deletions app/src/command/title-command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ Qx::Error TitleCommand::getTitleId(QUuid& id)
postError(err);
return err;
}
QUuid origId = titleId;
titleId = mCore.fpInstall().database()->handleGameRedirects(titleId); // Redirect shortcut
if(titleId != origId)
logEvent(LOG_EVENT_GAME_REDIRECT.arg(origId.toString(QUuid::WithoutBraces), titleId.toString(QUuid::WithoutBraces)));
}
else if(mParser.isSet(CL_OPTION_TITLE) || mParser.isSet(CL_OPTION_TITLE_STRICT))
{
Expand Down
1 change: 1 addition & 0 deletions app/src/command/title-command.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class TitleCommand : public Command
static inline const QString LOG_EVENT_SEL_RAND = u"Selecting a playable title at random..."_s;
static inline const QString LOG_EVENT_INIT_RAND_ID = u"Randomly chose primary title is \"%1\""_s;
static inline const QString LOG_EVENT_INIT_RAND_PLAY_ADD_COUNT = u"Chosen title has %1 playable additional-apps"_s;
static inline const QString LOG_EVENT_GAME_REDIRECT = u"Game redirected: %1 -> %2"_s;
static inline const QString LOG_EVENT_RAND_DET_PRIM = u"Selected primary title"_s;
static inline const QString LOG_EVENT_RAND_DET_ADD_APP = u"Selected additional-app \"%1\""_s;
static inline const QString LOG_EVENT_RAND_GET_INFO = u"Querying random game info..."_s;
Expand Down

0 comments on commit f060eac

Please sign in to comment.