From c3f911b3f41af1bb032ea643112b8fc402fc493e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alban=20F=C3=A9ron?= Date: Sun, 28 Nov 2021 15:13:33 +0100 Subject: [PATCH] Display version and proper URL on web UI --- supysonic/frontend/__init__.py | 8 +++++++- supysonic/templates/layout.html | 10 +++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/supysonic/frontend/__init__.py b/supysonic/frontend/__init__.py index 27ad49c..764d9c4 100644 --- a/supysonic/frontend/__init__.py +++ b/supysonic/frontend/__init__.py @@ -1,7 +1,7 @@ # This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # -# Copyright (C) 2013-2019 Alban 'spl0k' Féron +# Copyright (C) 2013-2021 Alban 'spl0k' Féron # 2017 Óscar García Amor # # Distributed under terms of the GNU AGPLv3 license. @@ -19,6 +19,7 @@ from flask import Blueprint from functools import wraps from pony.orm import ObjectNotFound +from .. import VERSION, DOWNLOAD_URL from ..daemon.client import DaemonClient from ..daemon.exceptions import DaemonUnavailableError from ..db import Artist, Album, Track @@ -27,6 +28,11 @@ from ..managers.user import UserManager frontend = Blueprint("frontend", __name__) +@frontend.context_processor +def inject_metadata(): + return {"version": VERSION, "download_url": DOWNLOAD_URL} + + @frontend.before_request def login_check(): request.user = None diff --git a/supysonic/templates/layout.html b/supysonic/templates/layout.html index b91cf05..c382c3f 100644 --- a/supysonic/templates/layout.html +++ b/supysonic/templates/layout.html @@ -2,7 +2,7 @@ This file is part of Supysonic. Supysonic is a Python implementation of the Subsonic server API. - Copyright (C) 2013-2018 Alban 'spl0k' Féron + Copyright (C) 2013-2021 Alban 'spl0k' Féron 2017 Óscar García Amor Distributed under terms of the GNU AGPLv3 license. @@ -86,10 +86,10 @@