archivebox.core.list_results_util
ArchiveResult summaries for snapshot list pages.
The public index and the admin snapshot changelist show, per snapshot: progress counts, per-plugin sizes, one file icon per successful plugin (linking to that result’s embed path), a favicon and a thumbnail.
Loading every result as a model instance with its output_files manifest
used to dominate these pages: model construction (field converters, signals,
descriptors) for every row, plus decoding manifests nothing renders. Here:
every result is one plain value row, never a model instance;
single-result plugin sizes come from the materialized
output_sizecolumn;multi-hook plugin sizes deduplicate their shared manifest paths;
the same query ships
output_filesas text for links, thumbnail candidates and multi-hook groups. Other rows never transfer theirs. Manifests are decoded only when rendering needs a link or must deduplicate a plugin’s file sizes.
List pages must never read the archive filesystem; nothing here does.
Module Contents
Classes
One ArchiveResult as list pages read it: a value row, not a model instance. |
|
Everything list pages display about one snapshot’s ArchiveResults. |
Functions
Load a page of snapshots’ results in one query, keyed by snapshot id. |
|
Build the deferred ArchiveResult a |
Data
API
- class archivebox.core.list_results_util.ListResult[source]
One ArchiveResult as list pages read it: a value row, not a model instance.
Duck-types the attributes and
embed_path()that icon, favicon and thumbnail rendering read from ArchiveResult instances. Ids are hex strings, the way CompactUUIDs print.
- class archivebox.core.list_results_util.SnapshotListResults[source]
Everything list pages display about one snapshot’s ArchiveResults.
- results: list[archivebox.core.list_results_util.ListResult][source]
‘field(…)’
- thumbnail_result: archivebox.core.models.ArchiveResult | None[source]
None
- first_succeeded_by_plugin(*, with_output: bool = False) dict[str, archivebox.core.list_results_util.ListResult][source]
First successful result per plugin; optionally only results that saved bytes.
- archivebox.core.list_results_util.load_snapshot_list_results(snapshots: collections.abc.Iterable[Any]) dict[Any, archivebox.core.list_results_util.SnapshotListResults][source]
Load a page of snapshots’ results in one query, keyed by snapshot id.
Embed paths and each snapshot’s thumbnail card are resolved here, from the same rows, so rendering never queries per snapshot or per result.
- archivebox.core.list_results_util._archive_result_from_row(row: archivebox.core.list_results_util.ListResult) archivebox.core.models.ArchiveResult[source]
Build the deferred ArchiveResult a
.only()query would have loaded.Card rendering requires a real ArchiveResult; one per snapshot is cheap.