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 {
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();
});
}