mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-29 19:03:03 +00:00
Allow re-downloading failed media.
This commit is contained in:
parent
e209299af4
commit
805e4d01e7
@ -379,7 +379,8 @@ void DocumentOpenClickHandler::Open(
|
||||
return;
|
||||
}
|
||||
|
||||
if (data->status != FileReady) return;
|
||||
if (data->status != FileReady
|
||||
&& data->status != FileDownloadFailed) return;
|
||||
|
||||
QString filename;
|
||||
if (!data->saveToCache()
|
||||
|
@ -945,7 +945,7 @@ int mtpFileLoader::finishSentRequestGetOffset(mtpRequestId requestId) {
|
||||
bool mtpFileLoader::feedPart(int offset, bytes::const_span buffer) {
|
||||
Expects(!_finished);
|
||||
|
||||
if (buffer.size()) {
|
||||
if (!buffer.empty()) {
|
||||
if (_fileIsOpen) {
|
||||
auto fsize = _file.size();
|
||||
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;
|
||||
}
|
||||
if (_sentRequests.empty()
|
||||
|
Loading…
Reference in New Issue
Block a user