[scrobbles] Fix display of task notes
All checks were successful
build & deploy / test (push) Successful in 1m40s
build & deploy / deploy (push) Successful in 21s

This commit is contained in:
2026-03-24 15:10:33 -04:00
parent cce2db0ea1
commit 4121915aa3
4 changed files with 149 additions and 33 deletions

View File

@ -1,3 +1,4 @@
import json
from dataclasses import dataclass
from typing import Optional
@ -45,15 +46,20 @@ class TaskLogData(BaseLogData):
lines = []
if self.notes:
for note in self.notes:
notes = self.notes
if isinstance(notes, str):
notes = [notes]
for note in notes:
if isinstance(note, dict):
timestamp, note_text = next(iter(note.items()))
# Flatten newlines and clean whitespace
note_text = " ".join(note_text.strip().split())
lines.append(f"{timestamp}: {note_text} [{labels_str}]")
if isinstance(note, list):
lines += note
if isinstance(note, str):
lines.append(note)
return "\n".join(lines).encode("utf-8").decode("unicode_escape")