diff --git a/core/include/JellyfinQt/support/loader.h b/core/include/JellyfinQt/support/loader.h index 7611aee..b150739 100644 --- a/core/include/JellyfinQt/support/loader.h +++ b/core/include/JellyfinQt/support/loader.h @@ -193,6 +193,7 @@ private: void onRequestFinished() { if (m_reply->error() != QNetworkReply::NoError) { m_reply->deleteLater(); + m_parsedWatcher.cancel(); //: An HTTP has occurred. First argument is replaced by QNetworkReply->errorString() this->stopWithError(QStringLiteral("HTTP error: %1").arg(m_reply->errorString())); } @@ -223,11 +224,15 @@ private: } void onResponseParsed() { + Q_ASSERT(m_parsedWatcher.isFinished()); if (m_parsedWatcher.result().has_value()) { - R result = m_parsedWatcher.result().value(); - this->m_result = result; - this->m_isRunning = false; - emit this->ready(); + try { + this->m_result = m_parsedWatcher.result().value(); + this->m_isRunning = false; + emit this->ready(); + } catch (QException &e) { + this->stopWithError(e.what()); + } } else { this->m_isRunning = false; } diff --git a/core/src/viewmodel/playbackmanager.cpp b/core/src/viewmodel/playbackmanager.cpp index eba0518..dfec717 100644 --- a/core/src/viewmodel/playbackmanager.cpp +++ b/core/src/viewmodel/playbackmanager.cpp @@ -361,6 +361,7 @@ void PlaybackManager::onItemUrlReceived(const QString &itemId, const QUrl &url, void PlaybackManager::onItemErrorReceived(const QString &itemId, const QString &errorString) { Q_UNUSED(itemId) Q_UNUSED(errorString) + qWarning() << "Error while fetching streaming url for " << itemId << ": " << errorString; } } // NS ViewModel