Don't count items already in interface as pending updates
authorJack Miller <jack@codezen.org>
Fri, 9 Jan 2015 22:17:01 +0000 (16:17 -0600)
committerJack Miller <jack@codezen.org>
Fri, 9 Jan 2015 22:22:27 +0000 (16:22 -0600)
The data has made a round trip, but this makes the grey update indicator
into an pending new item count instead of something more nebulous.

canto_curses/tag.py

index 6e31e7e..0e6c482 100644 (file)
@@ -155,8 +155,11 @@ class Tag(PluginHandler, list):
                 break
 
     def on_items_added(self, tagcore, added):
+        cur_ids = self.get_ids()
         if tagcore == self.tagcore:
-            self.updates_pending += len(added)
+            for story_id in added:
+                if story_id not in cur_ids:
+                    self.updates_pending += 1
             self.need_redraw()
 
     # We override eq so that empty tags don't evaluate