summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/App/BorgRestore.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/App/BorgRestore.pm b/lib/App/BorgRestore.pm
index edc009c..d96b957 100644
--- a/lib/App/BorgRestore.pm
+++ b/lib/App/BorgRestore.pm
@@ -235,6 +235,19 @@ method get_all_archives() {
return \@ret;
}
+=head3 cache_contains_data
+
+ if ($app->cache_contains_data()) { ... }
+
+Returns 1 if the cache contains any archive data, 0 otherwise.
+
+=cut
+
+method cache_contains_data() {
+ my $existing_archives = $self->{db}->get_archive_names();
+ return @{$existing_archives}+0 > 0 ? 1 : 0;
+}
+
=head3 select_archive_timespec
my $archive = $app->select_archive_timespec($archives, $timespec);