From dc6c9c2d8ca2da58f1363b6741bbd46e7a1d088d Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Mon, 10 Aug 2015 10:53:29 +0200 Subject: [PATCH] Fix updating of last check time --- src/channelaggregator.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/channelaggregator.cpp b/src/channelaggregator.cpp index 97b369d..f64272b 100644 --- a/src/channelaggregator.cpp +++ b/src/channelaggregator.cpp @@ -97,7 +97,6 @@ void ChannelAggregator::processNextChannel() { YTChannel* channel = getChannelToCheck(); if (channel) { checkWebPage(channel); - channel->updateChecked(); } else finish(); } @@ -119,13 +118,20 @@ void ChannelAggregator::parseWebPage(const QByteArray &bytes) { // qDebug() << "Comparing" << videoId << latestVideoId; hasNewVideos = videoId != latestVideoId; } - if (hasNewVideos) reallyProcessChannel(currentChannel); - else processNextChannel(); + if (hasNewVideos) { + reallyProcessChannel(currentChannel); + currentChannel = 0; + } else { + currentChannel->updateChecked(); + currentChannel = 0; + processNextChannel(); + } } void ChannelAggregator::errorWebPage(QNetworkReply *reply) { Q_UNUSED(reply); reallyProcessChannel(currentChannel); + currentChannel = 0; } void ChannelAggregator::reallyProcessChannel(YTChannel *channel) { @@ -137,6 +143,8 @@ void ChannelAggregator::reallyProcessChannel(YTChannel *channel) { YTSearch *videoSource = new YTSearch(params, this); connect(videoSource, SIGNAL(gotVideos(QList)), SLOT(videosLoaded(QList))); videoSource->loadVideos(50, 1); + + channel->updateChecked(); } void ChannelAggregator::finish() { -- 2.39.5