background: reload screenshot if reload_cmd specified (#903)

This commit is contained in:
Nathan.Woodburn/ 2025-10-29 05:20:34 +11:00 committed by GitHub
parent 36ec73f166
commit 98b86752fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,12 +72,13 @@ void CBackground::configure(const std::unordered_map<std::string, std::any>& pro
} else if (!path.empty())
resourceID = g_asyncResourceManager->requestImage(path, m_imageRevision, nullptr);
if (!isScreenshot && reloadTime > -1) {
if (!reloadCommand.empty() && reloadTime > -1) {
try {
modificationTime = std::filesystem::last_write_time(absolutePath(path, ""));
if (!isScreenshot)
modificationTime = std::filesystem::last_write_time(absolutePath(path, ""));
} catch (std::exception& e) { Debug::log(ERR, "{}", e.what()); }
plantReloadTimer(); // No reloads for screenshots.
plantReloadTimer(); // No reloads if reloadCommand is empty
}
}