From 112de551247342daaf62ecc715c54dc6697aa2de Mon Sep 17 00:00:00 2001 From: John Doty Date: Fri, 22 Nov 2024 21:24:34 -0800 Subject: [PATCH] I don't know man --- cry/database.py | 4 ++-- cry/feed.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cry/database.py b/cry/database.py index d3c90cb..3ef2a6d 100644 --- a/cry/database.py +++ b/cry/database.py @@ -195,8 +195,8 @@ class Database: return db @classmethod - def from_file(cls, path: pathlib.Path) -> "Database": - db = Database(path, "", readonly=True) + def from_file(cls, path: pathlib.Path, readonly: bool = True) -> "Database": + db = Database(path, "", readonly=readonly) origin = db.get_property("origin") if origin is None: raise Exception("No origin!") diff --git a/cry/feed.py b/cry/feed.py index 856e2ef..ca4b73f 100644 --- a/cry/feed.py +++ b/cry/feed.py @@ -115,9 +115,10 @@ class Entry: # NOTE: Take insert_time if it's smaller; publish time errors generate # posts from the future. - posted_at = min(int(calendar.timegm(published) * 1000), insert_time) + pub_time = int(calendar.timegm(published) * 1000) + posted_at = min(pub_time, insert_time) else: - posted_at = int(insert_time) + posted_at = insert_time assert isinstance(id, str) assert link is None or isinstance(link, str)