I don't know man

This commit is contained in:
John Doty 2024-11-22 21:24:34 -08:00
parent 82fbae2486
commit 112de55124
2 changed files with 5 additions and 4 deletions

View file

@ -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!")

View file

@ -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)