not saving feed items title in the database anymore
This commit is contained in:
parent
037272a167
commit
61a2d8d215
|
@ -150,10 +150,10 @@ class Database:
|
||||||
"""Replace last feed items with a list items that receive."""
|
"""Replace last feed items with a list items that receive."""
|
||||||
self.log.debug('update_feed_items(feed_id=\'%s\', new_items=list(%d))', feed_id, len(new_items))
|
self.log.debug('update_feed_items(feed_id=\'%s\', new_items=list(%d))', feed_id, len(new_items))
|
||||||
for i, _ in enumerate(new_items):
|
for i, _ in enumerate(new_items):
|
||||||
new_items[i] = [feed_id] + [new_items[i].url, new_items[i].title, new_items[i].guid]
|
new_items[i] = [feed_id] + [new_items[i].url, new_items[i].guid]
|
||||||
self.cur.execute('DELETE FROM feeds_last_items WHERE feed_id = %s', [feed_id])
|
self.cur.execute('DELETE FROM feeds_last_items WHERE feed_id = %s', [feed_id])
|
||||||
self.cur.executemany(
|
self.cur.executemany(
|
||||||
'INSERT INTO feeds_last_items (feed_id, url, title, guid) VALUES (%s, %s, %s, %s)', new_items)
|
'INSERT INTO feeds_last_items (feed_id, url, guid) VALUES (%s, %s, %s)', new_items)
|
||||||
self.conn.commit()
|
self.conn.commit()
|
||||||
|
|
||||||
def __init_schema(self) -> None:
|
def __init_schema(self) -> None:
|
||||||
|
@ -173,7 +173,6 @@ class Database:
|
||||||
'CREATE TABLE IF NOT EXISTS feeds_last_items ('
|
'CREATE TABLE IF NOT EXISTS feeds_last_items ('
|
||||||
' feed_id INTEGER REFERENCES feeds ON DELETE CASCADE,'
|
' feed_id INTEGER REFERENCES feeds ON DELETE CASCADE,'
|
||||||
' url TEXT NOT NULL,'
|
' url TEXT NOT NULL,'
|
||||||
' title TEXT,'
|
|
||||||
' guid TEXT'
|
' guid TEXT'
|
||||||
')'
|
')'
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue