feat: add details
signal to Task
feat: add details to mod pack downloading feat: add logging rule sloading form `ligging.ini at data path root feat: add `launcher.task` `launcher.task.net` and `launcher.task.net.[down|up]load` logging categories fix: add new subtask progress to the end of the lay out not the beginning (cuts down on flickering) Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
@ -39,6 +39,8 @@
|
||||
#include <QRegularExpression>
|
||||
#include "Application.h"
|
||||
|
||||
#include "logging.h"
|
||||
|
||||
namespace Net {
|
||||
|
||||
/** Maximum time to hold a cache entry
|
||||
@ -97,11 +99,11 @@ Task::State MetaCacheSink::finalizeCache(QNetworkReply & reply)
|
||||
|
||||
{ // Cache lifetime
|
||||
if (m_is_eternal) {
|
||||
qDebug() << "[MetaCache] Adding eternal cache entry:" << m_entry->getFullPath();
|
||||
qCDebug(taskNetLogC) << "[MetaCache] Adding eternal cache entry:" << m_entry->getFullPath();
|
||||
m_entry->makeEternal(true);
|
||||
} else if (reply.hasRawHeader("Cache-Control")) {
|
||||
auto cache_control_header = reply.rawHeader("Cache-Control");
|
||||
// qDebug() << "[MetaCache] Parsing 'Cache-Control' header with" << cache_control_header;
|
||||
// qCDebug(taskNetLogC) << "[MetaCache] Parsing 'Cache-Control' header with" << cache_control_header;
|
||||
|
||||
QRegularExpression max_age_expr("max-age=([0-9]+)");
|
||||
qint64 max_age = max_age_expr.match(cache_control_header).captured(1).toLongLong();
|
||||
@ -109,7 +111,7 @@ Task::State MetaCacheSink::finalizeCache(QNetworkReply & reply)
|
||||
|
||||
} else if (reply.hasRawHeader("Expires")) {
|
||||
auto expires_header = reply.rawHeader("Expires");
|
||||
// qDebug() << "[MetaCache] Parsing 'Expires' header with" << expires_header;
|
||||
// qCDebug(taskNetLogC) << "[MetaCache] Parsing 'Expires' header with" << expires_header;
|
||||
|
||||
qint64 max_age = QDateTime::fromString(expires_header).toSecsSinceEpoch() - QDateTime::currentSecsSinceEpoch();
|
||||
m_entry->setMaximumAge(max_age);
|
||||
@ -119,7 +121,7 @@ Task::State MetaCacheSink::finalizeCache(QNetworkReply & reply)
|
||||
|
||||
if (reply.hasRawHeader("Age")) {
|
||||
auto age_header = reply.rawHeader("Age");
|
||||
// qDebug() << "[MetaCache] Parsing 'Age' header with" << age_header;
|
||||
// qCDebug(taskNetLogC) << "[MetaCache] Parsing 'Age' header with" << age_header;
|
||||
|
||||
qint64 current_age = age_header.toLongLong();
|
||||
m_entry->setCurrentAge(current_age);
|
||||
|
Reference in New Issue
Block a user