1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 08:56:17 +00:00

Display version and proper URL on web UI

This commit is contained in:
Alban Féron 2021-11-28 15:13:33 +01:00
parent 98ff73738d
commit c3f911b3f4
No known key found for this signature in database
GPG Key ID: 8CE0313646D16165
2 changed files with 12 additions and 6 deletions

View File

@ -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

View File

@ -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 @@
<hr />
<footer>
<p>Supysonic <a href="https://github.com/spl0k/supysonic">source
code</a> is available under the <a
href="http://www.gnu.org/licenses/agpl-3.0.html">GNU
Affero General Public License version 3</a>.</p>
<p>Supysonic version {{ version }}. Its
<a href="{{ download_url }}/tree/{{ version }}">source code</a> is available
under the <a href="http://www.gnu.org/licenses/agpl-3.0.html">GNU Affero
General Public License version 3</a>.</p>
</footer>
</div> <!-- /container -->