Skip to content

Commit f19c75a

Browse files
committed
fix progress bar
1 parent be3287e commit f19c75a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • customizer/src/obs_case_customizer

customizer/src/obs_case_customizer/app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from fastapi.responses import RedirectResponse, JSONResponse
2020
from fastapi.templating import Jinja2Templates
2121
from fastapi.websockets import WebSocket
22-
from pydantic import BaseModel
22+
from pydantic import BaseModel, Field
2323
from websockets.exceptions import ConnectionClosed
2424

2525
THREADS = int(os.environ.get('CUSTOMIZER_THREADS', 10))
@@ -263,7 +263,7 @@ class CustomVariables(BaseModel):
263263
m3_screw_diameter_tight: float = 3
264264
m3_screw_diameter_loose: float = 3.25
265265
m3_insert_hole_diameter: float = 4
266-
m3_hex_nut_diameter: float = 6
266+
m3_hex_nut_diameter: float = Field(6, title='The height in cm', ge=5, le=6)
267267
SeatPostMount_angle: float = 20
268268
SeatPostMount_diameter: float = 28
269269
SeatPostMount_length: float = 20
@@ -321,7 +321,7 @@ async def jobstate(websocket: WebSocket, uid: uuid.UUID):
321321
for c in glob.glob(f"{temp / 'temp' / 'export'}/**/*.stl", recursive=True)
322322
]
323323

324-
progress = (len(completed) / (len(info['parts']) + 1))
324+
progress = (len(completed) / (len(info['parts'])))
325325

326326
try:
327327
await websocket.send_json({

0 commit comments

Comments
 (0)