diff --git a/app/templates/cache/media_list.html b/app/templates/cache/media_list.html index ce68f83..98dd81b 100644 --- a/app/templates/cache/media_list.html +++ b/app/templates/cache/media_list.html @@ -20,19 +20,24 @@ {% if items %}
{% for item in items %} - + {# Determine media category from type or filename #} + {% set is_image = item.type in ('image', 'image/jpeg', 'image/png', 'image/gif', 'image/webp') or (item.filename and item.filename.lower().endswith(('.jpg', '.jpeg', '.png', '.gif', '.webp'))) %} + {% set is_video = item.type in ('video', 'video/mp4', 'video/webm', 'video/x-matroska') or (item.filename and item.filename.lower().endswith(('.mp4', '.mkv', '.webm', '.mov'))) %} + {% set is_audio = item.type in ('audio', 'audio/mpeg', 'audio/wav', 'audio/flac') or (item.filename and item.filename.lower().endswith(('.mp3', '.wav', '.flac', '.ogg'))) %} - {% if item.media_type and item.media_type.startswith('image/') %} - + + {% if is_image %} + - {% elif item.media_type and item.media_type.startswith('video/') %} + {% elif is_video %}
-
- {% elif item.media_type and item.media_type.startswith('audio/') %} + {% elif is_audio %}
- {{ item.media_type or 'Unknown' }} + {{ item.type or 'Media' }}
{% endif %}
-
{{ item.hash[:16] }}...
- {% if item.size_bytes %} -
{{ item.size_bytes | filesizeformat }}
+
{{ item.content_hash[:16] }}...
+ {% if item.filename %} +
{{ item.filename }}
{% endif %}