Continue update of episodes even if gpodder server is unavailable
This commit is contained in:
parent
8097ffe513
commit
c44abc66ba
@ -211,14 +211,37 @@ void SyncJob::syncSubscriptions()
|
||||
if (subRequest->error() || subRequest->aborted()) {
|
||||
if (subRequest->aborted()) {
|
||||
Q_EMIT infoMessage(this, getProgressMessage(Aborted));
|
||||
emitResult();
|
||||
return;
|
||||
} else if (subRequest->error()) {
|
||||
setError(SyncJobError::SubscriptionDownloadError);
|
||||
setErrorText(subRequest->errorString());
|
||||
Q_EMIT infoMessage(this, getProgressMessage(Error));
|
||||
}
|
||||
// If this is a force sync (i.e. processing all updates), then
|
||||
// continue with fetching podcasts updates, otherwise it's not
|
||||
// possible to update new episodes if the sync server happens to be
|
||||
// down or is not reachable.
|
||||
if (m_forceFetchAll) {
|
||||
QSqlQuery query;
|
||||
query.prepare(QStringLiteral("SELECT url FROM Feeds;"));
|
||||
Database::instance().execute(query);
|
||||
while (query.next()) {
|
||||
QString url = query.value(0).toString();
|
||||
if (!m_feedsToBeUpdatedSubs.contains(url)) {
|
||||
m_feedsToBeUpdatedSubs += url;
|
||||
}
|
||||
}
|
||||
m_feedUpdateTotal = m_feedsToBeUpdatedSubs.count();
|
||||
setProcessedAmount(KJob::Unit::Items, processedAmount(KJob::Unit::Items) + 2); // skip upload step
|
||||
Q_EMIT infoMessage(this, getProgressMessage(SubscriptionFetch));
|
||||
|
||||
QTimer::singleShot(0, this, &SyncJob::fetchModifiedSubscriptions);
|
||||
} else {
|
||||
emitResult();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
qCDebug(kastsSync) << "Finished device update request";
|
||||
|
||||
qulonglong newSubscriptionTimestamp = subRequest->timestamp();
|
||||
@ -288,6 +311,7 @@ void SyncJob::syncSubscriptions()
|
||||
QTimer::singleShot(0, this, [=]() {
|
||||
uploadSubscriptions(localAddFeedList, localRemoveFeedList);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user