fix the_line_after_metadata()

This commit is contained in:
veclav talica 2024-02-16 19:59:57 +05:00
parent c36ce7dd20
commit d7a434ea11

View File

@ -2,7 +2,7 @@ import time, subprocess
def the_line_after_metadata(lines: []) -> int:
i = 0
while lines[i].strip():
while i < len(lines) and lines[i].strip():
i += 1
return i
@ -19,7 +19,7 @@ def parse_metadata(filepath: str) -> {}:
result["Date"] = time.gmtime(int(val))
elif key == "Tags":
result["Tags"] = [v.strip() for v in val.split(",")]
else:
elif val:
result[key] = val
result["Last Edit"] = time.gmtime(int(subprocess.getoutput(r"stat -c %Y " + filepath)))