mirror of https://github.com/procxx/kepka.git
Allow re-downloading failed media.
This commit is contained in:
parent
e209299af4
commit
805e4d01e7
|
@ -379,7 +379,8 @@ void DocumentOpenClickHandler::Open(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->status != FileReady) return;
|
if (data->status != FileReady
|
||||||
|
&& data->status != FileDownloadFailed) return;
|
||||||
|
|
||||||
QString filename;
|
QString filename;
|
||||||
if (!data->saveToCache()
|
if (!data->saveToCache()
|
||||||
|
|
|
@ -945,7 +945,7 @@ int mtpFileLoader::finishSentRequestGetOffset(mtpRequestId requestId) {
|
||||||
bool mtpFileLoader::feedPart(int offset, bytes::const_span buffer) {
|
bool mtpFileLoader::feedPart(int offset, bytes::const_span buffer) {
|
||||||
Expects(!_finished);
|
Expects(!_finished);
|
||||||
|
|
||||||
if (buffer.size()) {
|
if (!buffer.empty()) {
|
||||||
if (_fileIsOpen) {
|
if (_fileIsOpen) {
|
||||||
auto fsize = _file.size();
|
auto fsize = _file.size();
|
||||||
if (offset < fsize) {
|
if (offset < fsize) {
|
||||||
|
@ -978,7 +978,7 @@ bool mtpFileLoader::feedPart(int offset, bytes::const_span buffer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!buffer.size() || (buffer.size() % 1024)) { // bad next offset
|
if (buffer.empty() || (buffer.size() % 1024)) { // bad next offset
|
||||||
_lastComplete = true;
|
_lastComplete = true;
|
||||||
}
|
}
|
||||||
if (_sentRequests.empty()
|
if (_sentRequests.empty()
|
||||||
|
|
Loading…
Reference in New Issue