mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-21 05:41:54 +02:00
only get archive_size if index.html is present within dir
This commit is contained in:
@@ -157,7 +157,7 @@ class SnapshotAdmin(SearchResultsAdminMixin, admin.ModelAdmin):
|
|||||||
return snapshot_icons(obj)
|
return snapshot_icons(obj)
|
||||||
|
|
||||||
def size(self, 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:
|
if archive_size:
|
||||||
size_txt = printable_filesize(archive_size)
|
size_txt = printable_filesize(archive_size)
|
||||||
if archive_size > 52428800:
|
if archive_size > 52428800:
|
||||||
|
Reference in New Issue
Block a user