diff backend/arangodb/FeedUpdater.py @ 259:304917762618 default tip

implementation of feed updates
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 12 Mar 2019 02:41:22 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/backend/arangodb/FeedUpdater.py	Tue Mar 12 02:41:22 2019 +0100
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+from backend.AbstractFeedUpdater import AbstractFeedUpdater
+from FeedEntry import FeedEntry
+
+class FeedUpdater(AbstractFeedUpdater):
+    def __init__(self, database, preferences):
+        super(FeedUpdater, self).__init__(preferences)
+        self.database = database
+
+    def _incrementFeedUpdateDate(self):
+        self.feed.increment_next_update_date()
+
+    def _processEntry(self, entry):
+        feed_entry = FeedEntry.find_by_link(entry.link, self.database)
+        if feed_entry is None:
+            self._createFeedEntry(entry)
\ No newline at end of file