add_player_btn_to(td_inject, 'add as play', `injectplay_${file.digest}`, !file.present)
add_tag_links_to(add_child_to('td', tr), file.tags_showable);
add_a_to(add_child_to('td', tr), file.rel_path, `${PATH_PREFIX_FILE}${file.digest}`);
+ add_child_to('td', tr, {textContent: file.last_update});
}
window.addEventListener('load', update_filter_inputs);
{% endblock %}
<th>actions</th>
<th>tags <button class="sorter" onclick="sort_by(this, 'n_tags'); ">count</button></th>
<th><button class="sorter" onclick="sort_by(this, 'rel_path'); ">path</button></th>
+<th><button class="sorter" onclick="sort_by(this, '-last_update'); ">last update</button></th>
</tr>
</table>
{% endblock %}
digest: Hash
tags: TagSet
# class attributes
+ last_update_cutoff: DatetimeStr
tags_prefilter_needed: TagSet
tags_prefilter_whitelist: TagSet
tags_display_whitelist: TagSet
ffprobe(self.full_path)['format']['duration'])))
self.last_update = last_update if last_update else _now_string()
self._hash_on_last_update = hash(self)
+ if not hasattr(self.__class__, 'last_update_cutoff'):
+ self.__class__.last_update_cutoff = _now_string()
def __hash__(self) -> int:
return hash(tuple(getattr(self, k) for k in self._cols))
'rel_path': str(self.rel_path),
'size': f'{self.size:.2f}',
'tags_showable': self.tags_showable.as_str_list,
+ 'last_update': (
+ '' if self.last_update < self.__class__.last_update_cutoff
+ else str(self.last_update)[:16].replace(' ', '·')),
}
def save(self, conn: DbConn) -> None: