1.5: Fuckin' UE5... #38

Manually merged
williamjcm merged 126 commits from one-point-five into master 2024-07-22 11:06:13 +02:00
Showing only changes of commit ccbafe5e30 - Show all commits

View file

@ -225,10 +225,12 @@ void
BackupManager::scanSubdir(Containers::StringView subdir) { BackupManager::scanSubdir(Containers::StringView subdir) {
static std::uint8_t depth = 0; static std::uint8_t depth = 0;
auto full_subdir = Utility::Path::join(conf().directories().backups, subdir);
using Flag = Utility::Path::ListFlag; using Flag = Utility::Path::ListFlag;
auto files = Utility::Path::list(conf().directories().backups, Flag::SkipDirectories|Flag::SkipSpecial); auto files = Utility::Path::list(full_subdir, Flag::SkipDirectories|Flag::SkipSpecial);
if(!files) { if(!files) {
LOG_ERROR_FORMAT("Couldn't list contents of {}.", conf().directories().backups); LOG_ERROR_FORMAT("Couldn't list contents of {}.", full_subdir);
} }
auto predicate = [](Containers::StringView file)->bool{ auto predicate = [](Containers::StringView file)->bool{
@ -241,9 +243,9 @@ BackupManager::scanSubdir(Containers::StringView subdir) {
zip_t* zip; zip_t* zip;
for(Containers::StringView file : files_view) { for(Containers::StringView file : files_view) {
Backup backup; Backup backup;
backup.filename = Utility::Path::join(subdir, file); backup.filename = Utility::Path::join(full_subdir, file);
zip = zip_open(Utility::Path::join(conf().directories().backups, file).data(), ZIP_RDONLY, &error_code); zip = zip_open(backup.filename.cbegin(), ZIP_RDONLY, &error_code);
if(zip == nullptr) { if(zip == nullptr) {
continue; continue;
} }
@ -301,16 +303,15 @@ BackupManager::scanSubdir(Containers::StringView subdir) {
arrayAppend(_backups, Utility::move(backup)); arrayAppend(_backups, Utility::move(backup));
} }
auto subdirs = Utility::Path::list(conf().directories().backups,
Flag::SkipFiles|Flag::SkipSpecial|Flag::SkipDotAndDotDot);
if(!subdirs) {
LOG_ERROR_FORMAT("Couldn't list contents of {}.", conf().directories().backups);
}
if(depth == 5) { if(depth == 5) {
return; return;
} }
auto subdirs = Utility::Path::list(full_subdir, Flag::SkipFiles|Flag::SkipSpecial|Flag::SkipDotAndDotDot);
if(!subdirs) {
LOG_ERROR_FORMAT("Couldn't list contents of {}.", full_subdir);
}
depth++; depth++;
for(auto& dir : *subdirs) { for(auto& dir : *subdirs) {