Fix PrintModal to fetch library file sliced_for_model

- Added query to fetch library file details in PrintModal
- Updated backend FileResponse schema to include metadata fields (print_name, print_time_seconds, filament_used_grams, sliced_for_model)
- Updated backend get_file endpoint to extract and return metadata fields
- Updated frontend LibraryFile interface to include metadata fields
- Now slicedForModel is properly extracted from both archives and library files

Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-04 03:06:54 +00:00
co-authored by cadtoolbox
parent 5b1e3e7a2b
commit 4cf58f9805
6 changed files with 68 additions and 35 deletions
+15
View File
@@ -1873,6 +1873,17 @@ async def get_file(
)
duplicate_count = len(duplicates)
# Extract key metadata fields
print_name = None
print_time = None
filament_grams = None
sliced_for_model = None
if file.file_metadata:
print_name = file.file_metadata.get("print_name")
print_time = file.file_metadata.get("print_time_seconds")
filament_grams = file.file_metadata.get("filament_used_grams")
sliced_for_model = file.file_metadata.get("sliced_for_model")
return FileResponseSchema(
id=file.id,
folder_id=file.folder_id,
@@ -1895,6 +1906,10 @@ async def get_file(
created_by_username=file.created_by.username if file.created_by else None,
created_at=file.created_at,
updated_at=file.updated_at,
print_name=print_name,
print_time_seconds=print_time,
filament_used_grams=filament_grams,
sliced_for_model=sliced_for_model,
)