better manifest

This commit is contained in:
2026-07-11 16:28:58 +02:00
parent 6f999b8ae7
commit c4331091ae
+14 -1
View File
@@ -11,10 +11,23 @@ IMAGEDIR = os.path.abspath(IMAGEDIR)
def main():
exts = ('.jpg', '.jpeg', '.png', '.webp', '.gif')
files = [f for f in sorted(os.listdir(IMAGEDIR)) if f.lower().endswith(exts)]
files = [
f for f in os.listdir(IMAGEDIR)
if f.lower().endswith(exts)
]
# Newest images first
files.sort(
key=lambda f: os.path.getctime(os.path.join(IMAGEDIR, f)),
reverse=True
)
out = os.path.join(IMAGEDIR, 'manifest.json')
with open(out, 'w', encoding='utf-8') as fh:
json.dump(files, fh, indent=2)
print(f'Wrote {len(files)} entries to {out}')
if __name__ == '__main__':