Skip to content

Commit

Permalink
don't create empty snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
grote committed Jul 26, 2024
1 parent 153c7f1 commit 7ac0db9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ internal class BackupResult(
backupMediaFiles = backupMediaFiles + other.backupMediaFiles,
backupDocumentFiles = backupDocumentFiles + other.backupDocumentFiles,
)

val isEmpty: Boolean = backupMediaFiles.isEmpty() && backupDocumentFiles.isEmpty()
}

internal class Backup(
Expand Down Expand Up @@ -134,6 +136,7 @@ internal class Backup(
fileBackup.backupFiles(filesResult.files, availableChunkIds, backupObserver)
}
val result = largeResult + smallResult
if (result.isEmpty) return // TODO maybe warn user that nothing could get backed up?
val backupSize = result.backupMediaFiles.sumOf { it.size } +
result.backupDocumentFiles.sumOf { it.size }
val endTime = System.currentTimeMillis()
Expand Down

0 comments on commit 7ac0db9

Please sign in to comment.