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) {
static std::uint8_t depth = 0;
auto full_subdir = Utility::Path::join(conf().directories().backups, subdir);
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) {
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{
@ -241,9 +243,9 @@ BackupManager::scanSubdir(Containers::StringView subdir) {
zip_t* zip;
for(Containers::StringView file : files_view) {
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) {
continue;
}
@ -301,16 +303,15 @@ BackupManager::scanSubdir(Containers::StringView subdir) {
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) {
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++;
for(auto& dir : *subdirs) {