2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Allow re-downloading failed media.

This commit is contained in:
John Preston
2019-01-21 10:49:44 +04:00
parent e209299af4
commit 805e4d01e7
2 changed files with 4 additions and 3 deletions

View File

@@ -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()