Skip to content

Commit

Permalink
Update entries whenever their .updated changes. #332
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon24 committed May 6, 2024
1 parent 5d6e95f commit e6a3853
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Version 3.13

Unreleased

* Update entries whenever their :attr:`~Entry.updated` changes,
don't compare the values. (:issue:`332`)


Version 3.12
------------
Expand Down
19 changes: 5 additions & 14 deletions src/reader/_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,10 @@ def debug(msg: str, *args: Any) -> None:
debug("entry new, updating")
return UpdateReasons()

new_updated = new.updated or new.published
old_updated = old.updated or old.published

if not new_updated:
debug("entry has no updated, updating")
return UpdateReasons()

if not (old_updated and new_updated <= old_updated):
# entry.updated was excluded from hash for (fake) symmetry with feed.
# https://github.com/lemon24/reader/issues/231#issuecomment-812601988
# Unlike feed.updated, we always trust entry.updated (so far).
if new.updated != old.updated:
debug("entry updated, updating")
return UpdateReasons()

Expand All @@ -196,12 +192,7 @@ def debug(msg: str, *args: Any) -> None:
)
return None

debug(
"entry not updated, skipping (old updated %s, new updated %s)",
old_updated,
new_updated,
)

debug("entry not updated, skipping")
return None

def get_entries_to_update(self, pairs: EntryPairs) -> Iterable[EntryUpdateIntent]:
Expand Down

0 comments on commit e6a3853

Please sign in to comment.