From a620a432c9fc7003c01ca2483b5371a471be5d5d Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Wed, 17 Jan 2024 17:54:28 +0100 Subject: [PATCH] boxart: save database regularly when scraping Issue #1117 --- core/rend/boxart/boxart.cpp | 5 +++-- core/rend/boxart/boxart.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/rend/boxart/boxart.cpp b/core/rend/boxart/boxart.cpp index 6462d87994..7ec447d7d5 100644 --- a/core/rend/boxart/boxart.cpp +++ b/core/rend/boxart/boxart.cpp @@ -130,12 +130,13 @@ void Boxart::fetchBoxart() } } } + saveDatabase(true); }); } -void Boxart::saveDatabase() +void Boxart::saveDatabase(bool internal) { - if (fetching.valid()) + if (!internal && fetching.valid()) fetching.get(); if (!databaseDirty) return; diff --git a/core/rend/boxart/boxart.h b/core/rend/boxart/boxart.h index 77f964cc41..a19680b237 100644 --- a/core/rend/boxart/boxart.h +++ b/core/rend/boxart/boxart.h @@ -33,7 +33,7 @@ class Boxart { public: GameBoxart getBoxart(const GameMedia& media); - void saveDatabase(); + void saveDatabase(bool internal = false); private: void loadDatabase();