From 47a790ccff3ec89961987ee0d8d9bb7488926100 Mon Sep 17 00:00:00 2001
From: Leon Styhre <leon@leonstyhre.com>
Date: Fri, 4 Aug 2023 17:54:02 +0200
Subject: [PATCH] The entire path is now included in the debug log output if a
 scraped file or folder is not in the root of the game directory

---
 es-app/src/scrapers/Scraper.cpp | 13 +++++++++++--
 es-app/src/scrapers/Scraper.h   |  2 --
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/es-app/src/scrapers/Scraper.cpp b/es-app/src/scrapers/Scraper.cpp
index b9f3d90ce..0d7f8a903 100644
--- a/es-app/src/scrapers/Scraper.cpp
+++ b/es-app/src/scrapers/Scraper.cpp
@@ -53,7 +53,16 @@ std::unique_ptr<ScraperSearchHandle> startScraperSearch(const ScraperSearchParam
         LOG(LogDebug) << "Scraper::startScraperSearch(): Scraping system \""
                       << params.system->getName()
                       << (params.game->getType() == FOLDER ? "\", folder \"" : "\", game file \"")
-                      << params.game->getFileName() << "\"";
+#if defined(_WIN64)
+                      << Utils::String::replace(
+                             params.game->getPath().substr(
+                                 params.game->getSystemEnvData()->mStartPath.length() + 1),
+                             "/", "\\")
+#else
+                      << params.game->getPath().substr(
+                             params.game->getSystemEnvData()->mStartPath.length() + 1)
+#endif
+                      << "\"";
         scraper_request_funcs.at(name)(params, handle->mRequestQueue, handle->mResults);
     }
 
@@ -103,7 +112,7 @@ void ScraperSearchHandle::update()
         // A request can add more requests to the queue while running,
         // so be careful with references into the queue.
         auto& req = *(mRequestQueue.front());
-        AsyncHandleStatus status = req.status();
+        AsyncHandleStatus status {req.status()};
 
         if (status == ASYNC_ERROR) {
             // Propagate error.
diff --git a/es-app/src/scrapers/Scraper.h b/es-app/src/scrapers/Scraper.h
index a42e154f3..d0e105877 100644
--- a/es-app/src/scrapers/Scraper.h
+++ b/es-app/src/scrapers/Scraper.h
@@ -108,8 +108,6 @@ class ScraperRequest : public AsyncHandle
 {
 public:
     ScraperRequest(std::vector<ScraperSearchResult>& resultsWrite);
-
-    // Returns "true" once we're done.
     virtual void update() = 0;
 
 protected: