]> git.sur5r.net Git - minitube/blob - src/invidious/ivvideosource.cpp
New upstream version 3.6.1
[minitube] / src / invidious / ivvideosource.cpp
1 #include "ivvideosource.h"
2
3 void IVVideoSource::loadVideos(int max, int startIndex) {
4     aborted = false;
5     retryCount = 0;
6     this->max = max;
7     this->startIndex = startIndex;
8     reallyLoadVideos(max, startIndex);
9 }
10
11 void IVVideoSource::abort() {
12     aborted = true;
13     retryCount = 0;
14     max = 0;
15     startIndex = 0;
16 }
17
18 void IVVideoSource::handleError(QString message) {
19     qDebug() << message;
20     if (retryCount < 4) {
21         qDebug() << "Retrying...";
22         Invidious::instance().shuffleServers();
23         reallyLoadVideos(max, startIndex);
24         retryCount++;
25     } else {
26         qWarning() << message;
27         emit error("Error loading videos");
28     }
29 }