[tasks] Fix emacs not updating or completing
This commit is contained in:
@ -39,15 +39,22 @@ class TaskLogData(BaseLogData):
|
||||
|
||||
def notes_as_str(self) -> str:
|
||||
"""Return formatted notes with line breaks and no keys"""
|
||||
note_block = ""
|
||||
if isinstance(self.notes, list):
|
||||
note_block = "</br>".join(self.notes)
|
||||
labels_str = ""
|
||||
if self.labels:
|
||||
labels_str = ", ".join(self.labels)
|
||||
|
||||
# DEPRECATED ... we don't store notes in dicts anymore
|
||||
if isinstance(self.notes, dict):
|
||||
for id, content in self.notes.items():
|
||||
note_block += content + "</br>"
|
||||
return note_block
|
||||
lines = []
|
||||
if self.notes:
|
||||
for note in self.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, str):
|
||||
lines.append(note)
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
class Task(LongPlayScrobblableMixin):
|
||||
@ -82,7 +89,7 @@ class Task(LongPlayScrobblableMixin):
|
||||
|
||||
def subtitle_for_user(self, user_id):
|
||||
scrobble = self.scrobbles(user_id).first()
|
||||
return scrobble.logdata.title or ""
|
||||
return scrobble.logdata.title or scrobble.log.get("title")
|
||||
|
||||
@classmethod
|
||||
def find_or_create(cls, title: str) -> "Task":
|
||||
|
||||
Reference in New Issue
Block a user