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)