summaryrefslogtreecommitdiffstats
path: root/ebknotify
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-03-31 22:35:53 +0200
committermakefu <github@syntax-fehler.de>2020-03-31 22:35:53 +0200
commitffef23f1854d8166eec75a5d94b2524a63e6e06c (patch)
tree7e141930e4a5b99e411cd10934170abdfda05cd0 /ebknotify
parente4942fdab9a43712d56b38dbdb8421d38d7743df (diff)
add sorted
Diffstat (limited to 'ebknotify')
-rw-r--r--ebknotify/feed.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/ebknotify/feed.py b/ebknotify/feed.py
index ce0e4a2..a09b79a 100644
--- a/ebknotify/feed.py
+++ b/ebknotify/feed.py
@@ -13,9 +13,8 @@ class Feed(FeedGenerator):
self.language('de')
def load_cache(self,cache) -> None:
- for item in cache.store.values():
- print(item)
- fe = self.add_entry()
+ for item in sorted(cache.store.values(),key= lambda f: f['notify']['creation']):
+ fe = self.add_entry(order='prepend')
available = 'available' if item['notify']['seen'] else 'sold'
fe.id(f"{item['notify']['url']}#{available}")
fe.category({'term':item['category']['localized-name']['value']})