1
0
Fork 0
mirror of synced 2024-06-28 11:00:35 +12:00

use database for num_outputs instead of legacy json

This commit is contained in:
Nick Sweeting 2020-11-28 01:05:53 -05:00
parent 7f2c834ea3
commit 411fdcac87

View file

@ -114,7 +114,7 @@ class Snapshot(models.Model):
@cached_property
def num_outputs(self):
return self.as_link().num_outputs
return self.archiveresult_set.filter(status='succeeded').count()
@cached_property
def url_hash(self):
@ -138,6 +138,7 @@ class Snapshot(models.Model):
@cached_property
def history(self):
# TODO: use ArchiveResult for this instead of json
from ..index import load_link_details
return load_link_details(self.as_link()).history