mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
Update isCorrupted with name indexing
This commit is contained in:
parent
3401882dc7
commit
0c7f5250f3
6 changed files with 8 additions and 8 deletions
|
@ -111,9 +111,9 @@ void AssetsBackupHandler::checkForAssetsToDelete() {
|
|||
}
|
||||
}
|
||||
|
||||
bool AssetsBackupHandler::isCorruptedBackup(const QString& filePath) {
|
||||
auto it = find_if(begin(_backups), end(_backups), [&](const std::vector<AssetServerBackup>::value_type& value) {
|
||||
return value.filePath == filePath;
|
||||
bool AssetsBackupHandler::isCorruptedBackup(const QString& backupName) {
|
||||
auto it = find_if(begin(_backups), end(_backups), [&](const AssetServerBackup& value) {
|
||||
return value.name == backupName;
|
||||
});
|
||||
|
||||
if (it == end(_backups)) {
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
void recoverBackup(const QString& backupName, QuaZip& zip) override;
|
||||
void deleteBackup(const QString& backupName) override;
|
||||
void consolidateBackup(const QString& backupName, QuaZip& zip) override;
|
||||
bool isCorruptedBackup(const QString& absoluteFilePath) override;
|
||||
bool isCorruptedBackup(const QString& backupName) override;
|
||||
|
||||
bool operationInProgress() { return getRecoveryStatus().first; }
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
virtual void recoverBackup(const QString& backupName, QuaZip& zip) = 0;
|
||||
virtual void deleteBackup(const QString& backupName) = 0;
|
||||
virtual void consolidateBackup(const QString& backupName, QuaZip& zip) = 0;
|
||||
virtual bool isCorruptedBackup(const QString& absoluteFilePath) = 0;
|
||||
virtual bool isCorruptedBackup(const QString& backupName) = 0;
|
||||
};
|
||||
using BackupHandlerPointer = std::unique_ptr<BackupHandlerInterface>;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
|
||||
void consolidateBackup(const QString& backupName, QuaZip& zip) override {}
|
||||
|
||||
bool isCorruptedBackup(const QString& absoluteFilePath) override { return true; }
|
||||
bool isCorruptedBackup(const QString& backupName) override { return false; }
|
||||
|
||||
private:
|
||||
DomainServerSettingsManager& _settingsManager;
|
||||
|
|
|
@ -372,7 +372,7 @@ void DomainContentBackupManager::getAllBackupsAndStatus(MiniPromise::Promise pro
|
|||
isAvailable &= handlerIsAvailable;
|
||||
availabilityProgress += progress / _backupHandlers.size();
|
||||
|
||||
isCorrupted = isCorrupted || handler->isCorruptedBackup(backup.absolutePath);
|
||||
isCorrupted = isCorrupted || handler->isCorruptedBackup(backup.id);
|
||||
}
|
||||
variantBackups.push_back(QVariantMap({
|
||||
{ "id", backup.id },
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
// Create a full backup
|
||||
void consolidateBackup(const QString& backupName, QuaZip& zip) override {}
|
||||
|
||||
bool isCorruptedBackup(const QString& absoluteFilePath) override { return false; }
|
||||
bool isCorruptedBackup(const QString& backupName) override { return false; }
|
||||
|
||||
private:
|
||||
QString _entitiesFilePath;
|
||||
|
|
Loading…
Reference in a new issue