Give canto-* attributes priority if it came from fetch thread
authorJack Miller <jack@codezen.org>
Mon, 1 Jun 2015 01:12:02 +0000 (20:12 -0500)
committerJack Miller <jack@codezen.org>
Mon, 1 Jun 2015 01:12:02 +0000 (20:12 -0500)
Lets plugins sub in internal content on fetch.

canto_next/feed.py

index d7ae7b0..c521094 100644 (file)
@@ -329,11 +329,12 @@ class CantoFeed(PluginHandler):
                         if key == "canto_update":
                             continue
                         if key == "canto-tags":
-                            for user_tag in olditem[key]:
+                            if key not in item:
+                                item[key] = olditem[key]
+                            for user_tag in item[key]:
                                 log.debug("index adding user tag: %s - %s" % (user_tag,item["id"]))
                                 tags_to_add.append((cacheitem["id"], user_tag))
-                            item[key] = olditem[key]
-                        elif key.startswith("canto"):
+                        elif key.startswith("canto") and key not in item:
                             item[key] = olditem[key]
                     break
             else: