[scrobbles] Fix display of task notes
This commit is contained in:
@ -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")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user