<p>known files (shown: {{files|length}}):</p>
<form action="files" method="POST">
<table>
+<tr><th>size</th><th>actions</th><th>path</th></tr>
{% for file in files %}
<tr>
+<td>{{ file.size | round(3) }}</td>
<td><input type="submit" name="play_{{file.rel_path_b64}}" value="play" {% if not file.present %}disabled {% endif %}/></td>
<td><a href="/{{page_names.file}}/{{file.rel_path_b64}}">{{file.rel_path}}</a></td>
</tr>
"""Return self.rel_path suffixed under PATH_DOWNLOADS."""
return PATH_DOWNLOADS.joinpath(self.rel_path)
+ @property
+ def size(self) -> float:
+ if not self.full_path.is_file():
+ return -1
+ return self.full_path.stat().st_size / (1024 * 1024)
+
@property
def present(self) -> bool:
"""Return if file exists in filesystem."""