Save redirect cache on destruction.

This commit is contained in:
Lukas Brübach 2025-06-11 17:16:43 +02:00
parent b936a9e379
commit 35eb98eb3b

View file

@ -63,6 +63,7 @@ PictureLoaderWorker::PictureLoaderWorker()
PictureLoaderWorker::~PictureLoaderWorker() PictureLoaderWorker::~PictureLoaderWorker()
{ {
saveRedirectCache();
pictureLoaderThread->deleteLater(); pictureLoaderThread->deleteLater();
} }
@ -145,7 +146,7 @@ void PictureLoaderWorker::imageLoadedSuccessfully(CardInfoPtr card, const QImage
void PictureLoaderWorker::cacheRedirect(const QUrl &originalUrl, const QUrl &redirectUrl) void PictureLoaderWorker::cacheRedirect(const QUrl &originalUrl, const QUrl &redirectUrl)
{ {
redirectCache[originalUrl] = qMakePair(redirectUrl, QDateTime::currentDateTimeUtc()); redirectCache[originalUrl] = qMakePair(redirectUrl, QDateTime::currentDateTimeUtc());
saveRedirectCache(); // saveRedirectCache();
} }
QUrl PictureLoaderWorker::getCachedRedirect(const QUrl &originalUrl) const QUrl PictureLoaderWorker::getCachedRedirect(const QUrl &originalUrl) const