From 47aa5ec591bc2fa415553d134816b15010a0fb62 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 11 Jan 2023 10:02:12 +0100 Subject: [PATCH] videos/sorted --- build.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index e893f82..d95a58c 100755 --- a/build.py +++ b/build.py @@ -88,13 +88,17 @@ def main(): } content = [] raw_category = os.path.join(raw_root, category) + videos = {} for directory, directories, files in os.walk(raw_category): for file in files: relative = os.path.relpath(directory, raw_root) name, _ = os.path.splitext(file) raw_file = os.path.join('raw', relative, file) web_file = os.path.join('web', relative, f'{name}.mp4') - content.append(card(name, web_file, raw_file)) + videos[name] = [web_file, raw_file] + for name, files in sorted(videos.items()): + web_file, raw_file = files + content.append(card(name, web_file, raw_file)) section['content'] = os.linesep.join(content) sections[category] = section for id, section in sections.items():