Add printer model display to file cards for .3mf files

Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-04 01:42:05 +00:00
co-authored by cadtoolbox
parent 248cbaf8f0
commit 4f54251189
4 changed files with 11 additions and 0 deletions
+3
View File
@@ -664,10 +664,12 @@ async def list_files(
print_name = None
print_time = None
filament_grams = None
sliced_for_model = None
if f.file_metadata:
print_name = f.file_metadata.get("print_name")
print_time = f.file_metadata.get("print_time_seconds")
filament_grams = f.file_metadata.get("filament_used_grams")
sliced_for_model = f.file_metadata.get("sliced_for_model")
file_list.append(
FileListResponse(
@@ -685,6 +687,7 @@ async def list_files(
print_name=print_name,
print_time_seconds=print_time,
filament_used_grams=filament_grams,
sliced_for_model=sliced_for_model,
)
)
+1
View File
@@ -154,6 +154,7 @@ class FileListResponse(BaseModel):
print_name: str | None = None
print_time_seconds: int | None = None
filament_used_grams: float | None = None
sliced_for_model: str | None = None
class Config:
from_attributes = True
+1
View File
@@ -3820,6 +3820,7 @@ export interface LibraryFileListItem {
print_name: string | null;
print_time_seconds: number | null;
filament_used_grams: number | null;
sliced_for_model: string | null;
}
export interface LibraryFileUpdate {
+6
View File
@@ -962,6 +962,12 @@ function FileCard({ file, isSelected, isMobile, onSelect, onDelete, onDownload,
</span>
)}
</div>
{file.sliced_for_model && (
<div className="mt-1 text-xs text-purple-400 flex items-center gap-1">
<Printer className="w-3 h-3" />
{file.sliced_for_model}
</div>
)}
{file.print_count > 0 && (
<div className="mt-1 text-xs text-bambu-green">
{t('fileManager.printedCount', { count: file.print_count })}