From 50441bae6279e52393a46f34f6a6c8ee68da6d66 Mon Sep 17 00:00:00 2001 From: verglor Date: Tue, 10 Nov 2020 18:08:22 +0100 Subject: [PATCH] Fix missing audio icon for other audio formats than mp3 --- cps/templates/author.html | 2 +- cps/templates/index.html | 2 +- cps/templates/search.html | 2 +- cps/web.py | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cps/templates/author.html b/cps/templates/author.html index 0015d6e2..f043e618 100644 --- a/cps/templates/author.html +++ b/cps/templates/author.html @@ -65,7 +65,7 @@ {% endif %} {% endfor %} {% for format in entry.data %} - {% if format.format|lower == 'mp3' %} + {% if format.format|lower in g.constants.EXTENSIONS_AUDIO %} {% endif %} {% endfor %} diff --git a/cps/templates/index.html b/cps/templates/index.html index e60f92fe..b9795b9a 100644 --- a/cps/templates/index.html +++ b/cps/templates/index.html @@ -104,7 +104,7 @@ {% endif %} {% endfor %} {% for format in entry.data %} - {% if format.format|lower == 'mp3' %} + {% if format.format|lower in g.constants.EXTENSIONS_AUDIO %} {% endif %} {%endfor%} diff --git a/cps/templates/search.html b/cps/templates/search.html index cba430a4..3b694229 100644 --- a/cps/templates/search.html +++ b/cps/templates/search.html @@ -67,7 +67,7 @@ {% endif %} {% endfor %} {% for format in entry.data %} - {% if format.format|lower == 'mp3' %} + {% if format.format|lower in g.constants.EXTENSIONS_AUDIO %} {% endif %} {% endfor %} diff --git a/cps/web.py b/cps/web.py index 3b337e7e..a5844f69 100644 --- a/cps/web.py +++ b/cps/web.py @@ -293,6 +293,7 @@ def edit_required(f): def before_request(): if current_user.is_authenticated: confirm_login() + g.constants = constants g.user = current_user g.allow_registration = config.config_public_reg g.allow_anonymous = config.config_anonbrowse