Skip to content

Play your Steam library's Windows games on a jailbroken PS5.

C++

Don't count games needing attention as queued

Leonardo Lobato7c49656f173f
diff --git a/src/homebrew/queue_layout.cpp b/src/homebrew/queue_layout.cpp
index ae8c6a1..ef67f75 100644
--- a/src/homebrew/queue_layout.cpp
+++ b/src/homebrew/queue_layout.cpp
@@ -174,7 +174,10 @@ QueueSection preparations(const State& state) {
void summarize(QueueSection& section, const std::string& expanded_words, const std::string& attention_words,
const char* idle) {
std::string text;
- const std::size_t more = section.rows.size() - section.completed; // unfinished, after the card
+ // Games after the card waiting their turn; what needs the player is counted apart.
+ const std::size_t more = static_cast<std::size_t>(std::count_if(section.rows.begin(), section.rows.end(), [](const QueueEntry& row) {
+ return row.job ? row.job->state == JobState::Queued || running(*row.job) : row.position > 0;
+ }));
if (section.expanded) {
text = expanded_words;
if (section.running && !section.waiting && !section.attention) join(text, "No games waiting");
diff --git a/tests/homebrew_library_model_test.cpp b/tests/homebrew_library_model_test.cpp
index 34e81d8..46136a2 100644
--- a/tests/homebrew_library_model_test.cpp
+++ b/tests/homebrew_library_model_test.cpp
@@ -2432,6 +2432,14 @@ void live_queue_lists_preparations_needing_attention() {
check(model.TakeRuntimePrepareRequests() == std::vector<GameId>{SteamId(31)}, "Try again asks for it");
activate(model, "prep-attn-30");
check(!has_row(model, "prep-retry-30"), "a game waiting for the PS5 is not prepared again from here");
+ model.action("circle");
+ // Closed with one being prepared: what needs the player is never counted as queued.
+ model.UpdatePreparationQueue({SteamId(33), {}, {}, {{SteamId(32), "No verified compatibility kit is installed."}}});
+ check(model.action("focus:queue-preparation"), "the heading takes focus");
+ activate(model, "queue-preparation");
+ check(!has_row(model, "prep-attn-30") &&
+ queue_row(model, "queue-preparation")->value == "No other games queued · 3 need attention",
+ "closed, it counts what needs attention apart from the queue");
}
// The game page of a waiting game names the game right ahead of it and offers Prepare next.