SpotifyCoverProvider: Fix trying to set timer to minus value

This commit is contained in:
Jonas Kvinge
2021-09-14 22:12:28 +02:00
parent 1a967597e8
commit 79a8450462

View File

@@ -80,7 +80,7 @@ SpotifyCoverProvider::SpotifyCoverProvider(Application *app, NetworkAccessManage
s.endGroup();
if (!refresh_token_.isEmpty()) {
quint64 time = expires_in_ - (QDateTime::currentDateTime().toSecsSinceEpoch() - login_time_);
qint64 time = expires_in_ - (QDateTime::currentDateTime().toSecsSinceEpoch() - login_time_);
if (time < 1) time = 1;
refresh_login_timer_.setInterval(static_cast<int>(time * kMsecPerSec));
refresh_login_timer_.start();