Explorar o código

fix: ensure dimensions are always shown immediately after upload and fix cache issues

unknown hai 2 meses
pai
achega
8c84011249
Modificáronse 3 ficheiros con 3 adicións e 2 borrados
  1. 1 1
      backend/config.py
  2. 1 1
      backend/routers/files.py
  3. 1 0
      src/components/ModelUploadSection.vue

+ 1 - 1
backend/config.py

@@ -12,7 +12,7 @@ DEBUG = os.getenv("RADIONICA_DEBUG", "True").lower() == "true"
 
 # Slicer Settings
 # If True, triggers synchronous slicing upon file upload (slower upload, exact metrics on UI)
-SYNC_SLICING_ON_UPLOAD = os.getenv("SYNC_SLICING", "False").lower() == "true"
+SYNC_SLICING_ON_UPLOAD = os.getenv("SYNC_SLICING", "True").lower() == "true"
 IS_WINDOWS = platform.system() == "Windows"
 
 if IS_WINDOWS:

+ 1 - 1
backend/routers/files.py

@@ -34,7 +34,7 @@ async def upload_files(background_tasks: BackgroundTasks, files: List[UploadFile
         print_time = None
         dimensions = None
         cached_record = db.execute_query(
-            "SELECT filament_g, print_time, dimensions FROM order_files WHERE file_hash = %s AND print_time IS NOT NULL LIMIT 1",
+            "SELECT filament_g, print_time, dimensions FROM order_files WHERE file_hash = %s AND print_time IS NOT NULL AND dimensions IS NOT NULL LIMIT 1",
             (file_hash,)
         )
         if cached_record:

+ 1 - 0
src/components/ModelUploadSection.vue

@@ -236,6 +236,7 @@
                 </span>
               </div>
               <div v-if="SHOW_ADVANCED_METRICS && file.printTime" class="flex gap-3 text-xs text-muted-foreground mt-0.5 opacity-80">
+                <span v-if="file.dimensions">📏 {{ file.dimensions }}</span>
                 <span v-if="file.printTime">⏱️ {{ file.printTime }}</span>
                 <span v-if="file.filamentG">⚖️ {{ file.filamentG.toFixed(1) }}g</span>
               </div>