feat: add human-readable datetime filter and update playlist info template
This commit is contained in:
@@ -97,3 +97,8 @@ def jellyfin_link(jellyfin_id: str) -> Markup:
|
||||
|
||||
link = f"{jellyfin_server_url}/web/#/details?id={jellyfin_id}"
|
||||
return Markup(f'<a href="{link}" target="_blank">{jellyfin_id}</a>')
|
||||
|
||||
# A template filter for displaying a datetime in a human-readable format
|
||||
@template_filter('human_datetime')
|
||||
def human_datetime(dt) -> str:
|
||||
return dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
@@ -7,7 +7,7 @@
|
||||
<h1>{{ item.name }}</h1>
|
||||
<p>{{ item.description }}</p>
|
||||
<p>{{ item.track_count }} songs, {{ total_duration }}</p>
|
||||
<p>Last Updated: {{ item.last_updated}} | Last Change: {{ item.last_changed}}</p>
|
||||
<p>Last Updated: {{ item.last_updated | human_datetime}} | Last Change: {{ item.last_changed | human_datetime}}</p>
|
||||
{% include 'partials/_add_remove_button.html' %}
|
||||
{% if session['is_admin'] and item.jellyfin_id %}
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user