videos/sorted
This commit is contained in:
parent
bf31e8a4c9
commit
47aa5ec591
1 changed files with 5 additions and 1 deletions
6
build.py
6
build.py
|
@ -88,13 +88,17 @@ def main():
|
||||||
}
|
}
|
||||||
content = []
|
content = []
|
||||||
raw_category = os.path.join(raw_root, category)
|
raw_category = os.path.join(raw_root, category)
|
||||||
|
videos = {}
|
||||||
for directory, directories, files in os.walk(raw_category):
|
for directory, directories, files in os.walk(raw_category):
|
||||||
for file in files:
|
for file in files:
|
||||||
relative = os.path.relpath(directory, raw_root)
|
relative = os.path.relpath(directory, raw_root)
|
||||||
name, _ = os.path.splitext(file)
|
name, _ = os.path.splitext(file)
|
||||||
raw_file = os.path.join('raw', relative, file)
|
raw_file = os.path.join('raw', relative, file)
|
||||||
web_file = os.path.join('web', relative, f'{name}.mp4')
|
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)
|
section['content'] = os.linesep.join(content)
|
||||||
sections[category] = section
|
sections[category] = section
|
||||||
for id, section in sections.items():
|
for id, section in sections.items():
|
||||||
|
|
Loading…
Reference in a new issue