From 177b5befeffb0c796d128b69474eda6c13173419 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 10 Apr 2024 22:03:50 +0200 Subject: [PATCH] The game media directory is now created on application startup instead of when first starting the scraper --- es-app/src/main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index adb3b2867..91990e0a9 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -871,6 +871,18 @@ int main(int argc, char* argv[]) #endif } + { + // Create the game media folder. + const std::string mediaDirectory {FileData::getMediaDirectory()}; + if (!Utils::FileSystem::exists(mediaDirectory)) { + LOG(LogInfo) << "Creating game media directory \"" << mediaDirectory << "\"..."; + Utils::FileSystem::createDirectory(mediaDirectory); + if (!Utils::FileSystem::exists(mediaDirectory)) { + LOG(LogWarning) << "Couldn't create directory, permission problems?"; + } + } + } + { #if defined(__ANDROID__) const std::string mediaDirectory {FileData::getMediaDirectory()};