瀏覽代碼

[tasks] Fix when note is a string

Colin Powell 1 周之前
父節點
當前提交
186ae18e1f
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      vrobbler/apps/scrobbles/scrobblers.py

+ 6 - 3
vrobbler/apps/scrobbles/scrobblers.py

@@ -721,9 +721,12 @@ def emacs_scrobble_update_task(
 
     notes_updated = False
     for note in emacs_notes:
-        existing_note_ts = [
-            n.get("timestamp") for n in scrobble.log.get("notes", [])
-        ]
+        try:
+            existing_note_ts = [
+                n.get("timestamp") for n in scrobble.log.get("notes", [])
+            ]
+        except AttributeError:
+            existing_note_ts = []
         if not scrobble.log.get('notes"'):
             scrobble.log["notes"] = []
         if note.get("timestamp") not in existing_note_ts: