replace into instead of update

This commit is contained in:
josch 2012-07-01 15:37:49 +02:00
parent 81e8e2de9a
commit a51f9f66c1

View file

@ -82,8 +82,8 @@ class SQLStorage():
self.conn.commit() self.conn.commit()
def update_feed(self, feed, values): def update_feed(self, feed, values):
self.conn.execute("""UPDATE feeds SET title=?, favicon=?, etag=?, lastmodified=?, unread=? WHERE feed=?""", self.conn.execute("""REPLACE INTO feeds (feed, title, favicon, etag, lastmodified, unread) VALUES (?,?,?,?,?,?)""",
(values['title'], values.get('favicon'), values.get('etag'), values.get('lastmodified'), values['unread'], feed)) (feed, values['title'], values.get('favicon'), values.get('etag'), values.get('lastmodified'), values['unread']))
self.conn.commit() self.conn.commit()
def set_favicon(self, feed, favicon): def set_favicon(self, feed, favicon):