1
0
mirror of https://github.com/natekspencer/hacs-oasis_mini.git synced 2025-11-11 22:53:51 -05:00

Fix track info with new format

This commit is contained in:
Nathan Spencer
2025-07-23 19:49:46 +00:00
parent 21fd8a63ba
commit 2d37fb691f
5 changed files with 10876 additions and 4374 deletions

View File

@@ -41,7 +41,7 @@ def draw_svg(track: dict, progress: int, model_id: str) -> str | None:
if progress is not None:
svg_content = decrypt_svg_content(svg_content)
paths = svg_content.split("L")
total = track.get("reduced_svg_content", {}).get(model_id, len(paths))
total = track.get("reduced_svg_content_new", 0) or len(paths)
percent = min((100 * progress) / total, 100)
progress = math.floor((percent / 100) * (len(paths) - 1))