async function update_files_list() {
const filter_path = encodeURIComponent(document.getElementById("input_filter_path").value);
let target = `${PATH_FILES_JSON}?filter_path=${filter_path}`;
+ {% if allow_show_absent %}
if (document.getElementById("input_show_absent").checked) { target = `${target}&show_absent=1`; }
+ {% endif %}
needed_tags.forEach((tag) => target = `${target}&needed_tag=${encodeURIComponent(tag)}`);
filtered_files = await wrapped_fetch(target).then((response) => response.json());
document.getElementById("files_count").textContent = `${filtered_files.length}`;
{% block body %}
filename pattern: <input id="input_filter_path" oninput="update_files_list()" /><br />
+{% if allow_show_absent %}
show absent: <input id="input_show_absent" type="checkbox" onclick="update_files_list()" /><br />
+{% endif %}
needed tags: <select id="tags_select" onchange="select_tag()"></select><br />
<span id="tags"></span>
<hr />
with DbConn() as conn:
showable_tags = sorted(list(VideoFile.all_tags_showable(conn)))
self._send_rendered_template(_NAME_TEMPLATE_FILES, {
+ 'allow_show_absent': self.server.config.allow_file_edit,
'showable_tags': showable_tags,
'needed_tags': self.params.all_for('needed_tag')})