Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion app/admin_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,20 @@ def collect_entries(self) -> list[schemas.AdminModelEntry]:
catalog_entries = [
self.build_entry(model) for model in self.ctx.manager.catalog if self.is_visible(model)
]
catalog_ids = {entry.id for entry in catalog_entries}
retired_entries = [
self.build_entry(model)
for installed in self.ctx.manager.installed()
if installed.retired
and installed.id not in catalog_ids
and (model := self.ctx.manager.catalog_model(installed.id)) is not None
]
custom_entries = [
self.build_custom_entry(custom)
for custom in self.ctx.manager.installed()
if custom.id.startswith("custom:")
]
return catalog_entries + custom_entries
return catalog_entries + retired_entries + custom_entries

def is_visible(self, model: Any) -> bool:
if self.system.is_apple_silicon:
Expand Down Expand Up @@ -216,6 +224,9 @@ def build_entry(self, model: Any) -> schemas.AdminModelEntry:
downloaded_bytes=download.downloaded_bytes if download else None,
total_bytes=download.total_bytes if download else None,
error=resolution[2],
retired=model.retired,
replacement_id=model.replacement_id,
retirement_reason=model.retirement_reason,
)

def build_custom_entry(self, custom: Any) -> schemas.AdminModelEntry:
Expand Down
Loading
Loading