Browse Source

use database for num_outputs instead of legacy json

Nick Sweeting 5 years ago
parent
commit
411fdcac87
1 changed files with 2 additions and 1 deletions
  1. 2 1
      archivebox/core/models.py

+ 2 - 1
archivebox/core/models.py

@@ -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