bambuddy/backend/app/services
maziggy 15ea11e10b Recover the preview slice from custom G-code the sidecar cannot parse
Opening the slice dialog on an unsliced project runs a preview slice purely
to ask the slicer which AMS slots the chosen plate consumes. Bambu Studio 2.8
writes {if timelapse_inline_photo} into the machine's time_lapse_gcode but
exports no definition for that variable, so the template is unresolvable the
moment it leaves Studio: an older sidecar stops with a placeholder parse error
before producing any slice_info. The preview returned nothing and the caller
fell back to guessing from painted faces, silently. On the H2D project this
was found with, the guess dropped the support material -- a whole slot off a
four-filament plate.

Retry the preview once with just the named template emptied, still on the
file's own settings. Keeping the embedded settings is what keeps the answer
honest: overriding the process preset instead discards the project's support
configuration, which loses that slot and moves used_g by up to 2x. Measured
against the same file: retry reproduces all four slots gram for gram, a
printer+process override returns three.

Only templates that cannot extrude are eligible -- a start or filament-change
template lays a prime line or purges, so emptying one would move the very
grams the preview reports, and returning nothing beats a confident wrong
number. Verified on a working H2D slice that emptying time_lapse_gcode leaves
every used_g/used_m in slice_info identical.

Match on a normalised option name: the slicer reports timelapse_gcode while
the 3MF stores time_lapse_gcode, so a literal comparison finds nothing.

Decide whether a retry applies before logging, so a slice that recovers does
not announce itself at WARNING twenty seconds before it succeeds.
2026-08-10 15:44:55 +02:00
..
git_providers Accept Forgejo tokens scoped to a single repository (#2775) 2026-08-06 12:08:36 +02:00
virtual_printer Add CAP_NET_BIND_SERVICE everywhere the service is defined (#2549) 2026-08-04 08:33:30 +02:00
__init__.py Added screenshots 2025-11-28 10:23:59 +01:00
archive.py Merge remote-tracking branch 'upstream/dev' into feature/billing 2026-08-05 20:19:32 +02:00
archive_comparison.py fix(archives): keep Quick Stats contribution when deleting a print (#1343) 2026-05-15 09:21:43 +02:00
archive_purge.py fix(archives): bulk and auto purge now honour the soft / hard delete choice from #1343 (#1390 follow-up) 2026-05-17 10:54:28 +02:00
backup_path.py fix(backup): diagnose an unwritable backup path instead of quoting errno 30 (#2544) 2026-07-12 08:44:53 +02:00
bambu_cloud.py Explain Bambu Cloud's CAPTCHA challenge instead of repeating it (#2790) 2026-08-08 10:04:55 +02:00
bambu_ftp.py Stop retrying a printer whose FTPS handshake fails, and name the cause (#2780) 2026-08-08 09:00:03 +02:00
bambu_mqtt.py Resolve the H2C rack nozzle at dispatch instead of letting firmware pick (#2800) 2026-08-10 08:54:44 +02:00
bug_report.py Add in-app bug reporting with relay, debug log collection, and privacy controls 2026-03-04 13:33:19 +01:00
camera.py fix(camera): rotate every still exactly once, and cover the sources that let ffmpeg write the file 2026-07-31 09:30:06 +02:00
camera_diagnose.py fix(camera): share one connection between concurrent one-shot captures (#2705) 2026-07-30 09:49:56 +02:00
camera_fanout.py fix(camera): stop /camera/stop from letting a second socket open (#2521) 2026-07-14 11:52:56 +02:00
camera_profiles.py fix(camera): P2S RTSP stream dropped every frame after the first (#1395) 2026-05-22 13:55:16 +02:00
design_settings.py feat(slicer): keep the designer's print settings when re-slicing for another printer (#2622) 2026-07-28 14:49:50 +02:00
diagnostic_snapshot.py ● feat(support): include sanitized connection / VP / log-health diagnostics in support bundle and bug report (#1506 follow-up) 2026-05-24 10:16:30 +02:00
discovery.py Fix timestamps off by timezone offset in non-UTC containers (#504) 2026-02-24 08:18:02 +01:00
email_service.py feat: Two-Factor Authentication (TOTP, Email OTP) and OIDC/SSO – full implementation with admin UI (#933) 2026-04-13 13:24:28 +02:00
export.py fix(projects): drop deleted prints from their project, and refresh the view (#2731) 2026-07-31 14:50:25 +02:00
external_camera.py Security hardening (maziggy/bambuddy-security #9) 2026-08-05 15:21:42 +02:00
failure_analysis.py fix(projects): drop deleted prints from their project, and refresh the view (#2731) 2026-07-31 14:50:25 +02:00
filament_deficit.py Check filament deficit for Library-backed queue items (#2779) 2026-08-06 12:21:50 +02:00
filament_requirements.py fix(queue): scope force-colour overrides to the plate the item prints (#2551) 2026-07-13 09:18:17 +02:00
finance_balance.py implemented pr (worth fixing) feedback 2026-08-06 20:27:25 +02:00
finance_billing.py implemented pr (worth fixing) feedback 2026-08-06 20:27:25 +02:00
finance_budget.py implemented pr (worth fixing) feedback 2026-08-06 20:27:25 +02:00
finance_defaults.py implemented pr (worth fixing) feedback 2026-08-06 20:27:25 +02:00
firmware_check.py feat(a2l): add Bambu Lab A2L support (#1684) 2026-06-10 10:59:27 +02:00
firmware_update.py fix(asyncio): track strong refs on orphan create_task sites 2026-06-06 10:41:28 +02:00
ftp_profiles.py fix(ftp): cap H2C FTPS to TLS 1.2 so the sliced 3MF downloads reliably (#2582) 2026-07-18 09:33:22 +02:00
github_backup.py fix(backup): resolve a restored archive's owner by username, not by id (#2656) 2026-08-05 16:09:20 -04:00
github_restore.py fix(backup): report the categories a failed restore already committed (#2656) 2026-08-06 08:46:02 +02:00
ha_sensor_manager.py Show Home Assistant sensors on the printer card (#1148, #448) 2026-08-05 14:26:38 +02:00
hms_actions.py [Feature]: HMS Actions (#1743) 2026-06-26 14:40:25 +02:00
hms_errors.py Add HMS error notifications with translations and plate detection fixes 2026-01-27 08:48:57 +01:00
homeassistant.py Show Home Assistant sensors on the printer card (#1148, #448) 2026-08-05 14:26:38 +02:00
label_renderer.py feat(labels): scannable QR on 203 dpi thermal printers + monochrome mode (#1870) 2026-07-07 10:31:19 +02:00
layer_timelapse.py Merge branch 'dev' into fix/camera-rotation-finish-photo-timelapse 2026-07-31 09:33:35 +02:00
ldap_service.py Survive a directory that defines no posixGroup class (#2769) 2026-08-05 11:14:57 +02:00
library_trash.py Add variant-group endpoints and cross-model queue creation (#671, #2570) 2026-08-03 11:10:11 +02:00
local_backup.py fix(backup): diagnose an unwritable backup path instead of quoting errno 30 (#2544) 2026-07-12 08:44:53 +02:00
location_service.py feat(inventory): structured storage locations catalog (#1505) 2026-06-17 11:33:23 +02:00
log_health.py Explain Bambu Cloud's CAPTCHA challenge instead of repeating it (#2790) 2026-08-08 10:04:55 +02:00
log_reader.py Security hardening (maziggy/bambuddy-security #N) 2026-07-29 12:36:17 +02:00
long_lived_tokens.py fix(overlay): authenticate the OBS overlay with a token when login is enabled (#2613) 2026-07-20 13:04:35 +02:00
loop_watchdog.py feat(diagnostics): event-loop stall watchdog to catch silent backend freezes 2026-05-22 09:28:43 +02:00
makerworld.py Explain Bambu Cloud's CAPTCHA challenge instead of repeating it (#2790) 2026-08-08 10:04:55 +02:00
mqtt_relay.py feat(printers): expose P2S/X2D accessory fans (left aux + exhaust) 2026-07-28 11:16:22 -05:00
mqtt_smart_plug.py fix(smart-plug): restore MQTT subscriptions for per-type topic configs on startup (#1010) 2026-04-19 13:51:58 +02:00
network_utils.py fix(vp): populate bind-interface list on macOS (route non-Linux to psutil) 2026-07-06 13:03:22 +02:00
notification_service.py Stop auto-drying re-arming into a threshold it can never reach (#2770) 2026-08-08 12:40:17 +02:00
obico_actions.py feat(notifications): dedicate AI Failure Detection notification event (#1794) 2026-06-22 08:15:29 +02:00
obico_detection.py feat(obico): authenticate to a token-protected ML API (#2733) 2026-07-31 13:39:17 +02:00
obico_smoothing.py feat(obico): AI print-failure detection via self-hosted Obico ML API (#172) 2026-04-13 09:54:26 +02:00
oidc_icon.py feat(auth): proxy OIDC provider icons server-side (#1333) (#1342) 2026-05-15 08:50:37 +02:00
opentag3d.py Feature/spoolman inventory UI (#1241) 2026-05-08 11:52:42 +02:00
orca_cloud.py feat(orca-cloud): pair via RFC 8628 device flow, replacing the paste-based sign-in 2026-07-17 08:16:35 +02:00
orca_profiles.py Fix AMS slot showing wrong material for "Support for" profiles 2026-03-03 13:34:03 +01:00
pipeline_eligibility.py feat(slicer): Pipelines — multi-copy + class targeting + fanout + runs dashboard + retry-failed + WS updates (#1425 PR C — completes the v3 design) 2026-06-27 16:52:05 +02:00
plate_detection.py fix(camera): reuse the live view's frame for external-camera captures (#2707) 2026-07-30 13:05:15 +02:00
plate_thumbnail.py fix(archives): render plate thumbnails server-side when sidecar slice skips them (#1759) 2026-06-19 07:28:09 +02:00
plug_energy_history.py fix(smart-plugs): read a REST plug's lifetime counter, and derive Today/Yesterday from it (issue #2539) 2026-07-11 14:22:31 +02:00
preset_resolver.py remove(slicer): drop bundle import; fix cloud preset type/from for CLI (#1712) 2026-06-12 10:14:06 +02:00
print_batch.py Add batch orders with a quantity per plate (#342) 2026-08-04 11:11:36 +02:00
print_cost_estimate.py implemented pr (worth fixing) feedback 2026-08-06 20:27:25 +02:00
print_dispatch_context.py fix(camera): take the finish photo when the print ends, not when its last layer starts (#2547) 2026-07-31 12:55:05 +02:00
print_log.py Add batch orders with a quantity per plate (#342) 2026-08-04 11:11:36 +02:00
print_scheduler.py Release the keep-warm bed on the dispatch paths that skip the rollback (#2727) 2026-08-10 13:54:44 +02:00
printer_diagnostic.py Stop retrying a printer whose FTPS handshake fails, and name the cause (#2780) 2026-08-08 09:00:03 +02:00
printer_manager.py Resolve the H2C rack nozzle at dispatch instead of letting firmware pick (#2800) 2026-08-10 08:54:44 +02:00
process_overrides.py Edit the full print-parameter set from the slice dialog 2026-08-08 16:33:41 +02:00
rest_smart_plug.py Security hardening (maziggy/bambuddy-security #8) 2026-07-31 08:18:05 +02:00
slice_dispatch.py Security fix (security-issue #6) 2026-07-24 09:15:03 +02:00
slice_preview.py Recover the preview slice from custom G-code the sidecar cannot parse 2026-08-10 15:44:55 +02:00
slicer_3mf_convert.py fix(slice): report a finished slice once, not once per queued poll 2026-07-30 17:14:07 +02:00
slicer_api.py Explain an oversized model instead of reporting a slicer crash (#2802) 2026-08-10 12:18:29 +02:00
slicer_filament_resolver.py fix(spoolbuddy): close #1815 — preserve PFUS/PFCN setting_id in resolver 2026-06-25 09:26:33 +02:00
slot_preset_writer.py fix(ams): keep slot card preset name in sync after spool swaps 2026-06-10 08:39:21 +02:00
smart_plug_manager.py fix(smart-plugs): don't blank printer state when an accessory plug switches off (#2629) 2026-07-22 09:57:27 +02:00
sponsor_prompt.py feat(sponsor-prompt): lower print/archive/cost thresholds to fire for typical new installs 2026-06-26 16:48:22 +02:00
spool_assignment_notifications.py fix(a2l): normalise AMS Lite unit 16->6 so slots load and deduct (#a2l-am-unit-16) 2026-07-21 10:21:11 +02:00
spool_csv.py feat(inventory): CSV import/export for the inventory page (#1576) (#1659) 2026-06-08 09:30:16 +02:00
spool_tag_matcher.py fix(ams): keep slot card preset name in sync after spool swaps 2026-06-10 08:39:21 +02:00
spoolbuddy_ssh.py fix(spoolbuddy): lower /update permission to INVENTORY_UPDATE so kiosk's own Settings -> Update button works 2026-05-08 14:28:41 +02:00
spoolman.py feat(inventory): toggle to disable auto-add of unknown RFID spools + global confirmation modal (issue #1764) 2026-06-23 09:59:05 +02:00
spoolman_tracking.py Read the printer's own slot mapping when Spoolman has none (#2768) 2026-08-05 11:04:59 +02:00
stl_thumbnail.py security: harden path-traversal class across routes + services; fifth CI backstop 2026-06-02 12:12:54 +02:00
tasmota.py Security hardening (maziggy/bambuddy-security #8) 2026-07-31 08:18:05 +02:00
timelapse_processor.py Remove unused imports, variables, and fix minor CodeQL findings 2026-02-06 12:19:17 +01:00
usage_tracker.py fix(inventory): record the mapped spool's material, not the sliced type (#2563) 2026-07-15 07:29:16 +02:00