From 236bf0ac1f687d6d990abda3a59ad3b9f0ce5dde Mon Sep 17 00:00:00 2001 From: jarvis2f <137974272+jarvis2f@users.noreply.github.com> Date: Tue, 7 Jan 2025 17:49:53 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Fixed=20the=20problem=20o?= =?UTF-8?q?f=20incorrect=20file=20download=20status=20after=20restarting.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/src/main/java/telegram/files/TelegramVerticle.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/src/main/java/telegram/files/TelegramVerticle.java b/api/src/main/java/telegram/files/TelegramVerticle.java index 822b485..a2a2d0b 100644 --- a/api/src/main/java/telegram/files/TelegramVerticle.java +++ b/api/src/main/java/telegram/files/TelegramVerticle.java @@ -424,6 +424,15 @@ public class TelegramVerticle extends AbstractVerticle { return Future.failedFuture("File not started downloading"); } if (isPaused && !file.local.isDownloadingActive) { + if (file.local.isDownloadingCompleted) { + return DataVerticle.fileRepository.updateStatus( + file.id, + file.remote.uniqueId, + file.local.path, + FileRecord.DownloadStatus.completed, + System.currentTimeMillis() + ).compose(r -> Future.failedFuture("File is already downloaded successfully")); + } return Future.failedFuture("File is not downloading"); } if (!isPaused && file.local.isDownloadingActive) {