From 48eddadc9b1689b09ad739f4171cfc034b1f8a2c Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 16 Feb 2021 06:16:02 -0500 Subject: [PATCH] inline archive_size and archive_path snapshot methods --- archivebox/core/models.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/archivebox/core/models.py b/archivebox/core/models.py index 7be705c3..bb7e53d2 100644 --- a/archivebox/core/models.py +++ b/archivebox/core/models.py @@ -144,11 +144,14 @@ class Snapshot(models.Model): @cached_property def archive_path(self): - return self.as_link().archive_path + return '{}/{}'.format(ARCHIVE_DIR_NAME, self.timestamp) @cached_property def archive_size(self): - return self.as_link().archive_size + try: + return get_dir_size(self.link_dir)[0] + except Exception: + return 0 @cached_property def history(self):