disable sleep whilst downloading, uploading, using usb, inside ftp menu.

This commit is contained in:
ITotalJustice
2025-05-20 23:33:51 +01:00
parent cf908d63b9
commit a67171e2b8
7 changed files with 42 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
#include "defines.hpp"
#include "evman.hpp"
#include "fs.hpp"
#include "app.hpp"
#include <switch.h>
#include <cstring>
@@ -669,6 +670,9 @@ void SetCommonCurlOptions(CURL* curl, const Api& e) {
}
auto DownloadInternal(CURL* curl, const Api& e) -> ApiResult {
App::SetAutoSleepDisabled(true);
ON_SCOPE_EXIT(App::SetAutoSleepDisabled(false));
// check if stop has been requested before starting download
if (e.GetToken().stop_requested()) {
return {};