]> git.sur5r.net Git - minitube/commitdiff
Fix updating of last check time
authorFlavio Tordini <flavio.tordini@gmail.com>
Mon, 10 Aug 2015 08:53:29 +0000 (10:53 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Mon, 10 Aug 2015 08:53:29 +0000 (10:53 +0200)
src/channelaggregator.cpp

index 97b369d40b0207c35fd56e333cb95f8141888644..f64272bf7cfaed3e1b8e1773eb915e4184974a8a 100644 (file)
@@ -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<Video*>)), SLOT(videosLoaded(QList<Video*>)));
     videoSource->loadVideos(50, 1);
+
+    channel->updateChecked();
 }
 
 void ChannelAggregator::finish() {