]> git.sur5r.net Git - minitube/blobdiff - src/ytjs/ytjs.cpp
New upstream version 3.6.1
[minitube] / src / ytjs / ytjs.cpp
index 086374189df6b83947bae1551167af451e8a9309..7153ef95b016b2749278e9c458070616297673d0 100644 (file)
@@ -31,6 +31,8 @@ Http &YTJS::cachedHttp() {
     static Http *h = [] {
         CachedHttp *cachedHttp = new CachedHttp(http(), "ytjs");
         cachedHttp->setMaxSeconds(3600 * 6);
+        // Avoid expiring the cached js
+        cachedHttp->setMaxSize(0);
         cachedHttp->setIgnoreHostname(true);
 
         cachedHttp->getValidators().insert("application/javascript", [](const auto &reply) -> bool {
@@ -77,12 +79,14 @@ void YTJS::initialize() {
 
     connect(cachedHttp().get(ytJs), &HttpReply::finished, this, [this](auto &reply) {
         if (!reply.isSuccessful()) {
-            emit initFailed("Cannot load " + ytJs);
+            emit initFailed("Cannot load JS");
+            qDebug() << "Cannot load JS";
             return;
         }
         evaluate(reply.body());
         ready = true;
         initializing = false;
+        qDebug() << "Initialized";
         emit initialized();
     });
 }