1
0
mirror of https://github.com/pirate/ArchiveBox.git synced 2025-08-20 13:21:52 +02:00

only get archive_size if index.html is present within dir

This commit is contained in:
Nick Sweeting
2021-02-16 15:51:17 -05:00
parent c24e4bf11d
commit a6c64f2560

View File

@@ -157,7 +157,7 @@ class SnapshotAdmin(SearchResultsAdminMixin, admin.ModelAdmin):
return snapshot_icons(obj)
def size(self, obj):
archive_size = obj.archive_size
archive_size = (Path(obj.link_dir) / 'index.html').exists() and obj.archive_size
if archive_size:
size_txt = printable_filesize(archive_size)
if archive_size > 52428800: