I don't know man
This commit is contained in:
parent
82fbae2486
commit
112de55124
2 changed files with 5 additions and 4 deletions
|
|
@ -195,8 +195,8 @@ class Database:
|
||||||
return db
|
return db
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_file(cls, path: pathlib.Path) -> "Database":
|
def from_file(cls, path: pathlib.Path, readonly: bool = True) -> "Database":
|
||||||
db = Database(path, "", readonly=True)
|
db = Database(path, "", readonly=readonly)
|
||||||
origin = db.get_property("origin")
|
origin = db.get_property("origin")
|
||||||
if origin is None:
|
if origin is None:
|
||||||
raise Exception("No origin!")
|
raise Exception("No origin!")
|
||||||
|
|
|
||||||
|
|
@ -115,9 +115,10 @@ class Entry:
|
||||||
|
|
||||||
# NOTE: Take insert_time if it's smaller; publish time errors generate
|
# NOTE: Take insert_time if it's smaller; publish time errors generate
|
||||||
# posts from the future.
|
# 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:
|
else:
|
||||||
posted_at = int(insert_time)
|
posted_at = insert_time
|
||||||
|
|
||||||
assert isinstance(id, str)
|
assert isinstance(id, str)
|
||||||
assert link is None or isinstance(link, str)
|
assert link is None or isinstance(link, str)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue