Skip to content

Commit

Permalink
Only exclude content read by this reader.
Browse files Browse the repository at this point in the history
  • Loading branch information
pagreene committed Sep 3, 2020
1 parent bf847c7 commit 513701d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion indra_db/managers/reading_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,13 @@ def read_new(self, db, reader_name):
*constraints
)
if self.only_unread:
tcid_q = tcid_q.except_(db.filter_query(db.Reading.text_content_id))
reader_class = get_reader_class(reader_name)
reader_version = reader_class.get_version()
tcid_q = tcid_q.except_(
db.filter_query(db.Reading.text_content_id,
db.Reading.reader == reader_name,
db.Reading.reader_version == reader_version)
)
tcids = {tcid for tcid, in tcid_q.all()}
if not tcids:
logger.info("Nothing new to read with %s." % reader_name)
Expand Down

0 comments on commit 513701d

Please sign in to comment.