fix client: download fallback to github release client

+ add fallback release version data to version.txt
+ move classproperty class to utils
+ update Dockerfile to install from source using pip install
+ move version info to Metadata class in settings.py
This commit is contained in:
wanji
2025-12-07 23:19:34 +03:00
parent d2b2ba6e02
commit 506c45c4fa
10 changed files with 86 additions and 61 deletions
+6 -2
View File
@@ -1,5 +1,4 @@
from dataclasses import asdict
from importlib import metadata
from typing import Any
from flask_openapi3 import Tag
from flask_openapi3 import APIBlueprint
@@ -9,6 +8,7 @@ from swingmusic.api.auth import admin_required
from swingmusic.db.userdata import PluginTable
from swingmusic.lib.index import index_everything
from swingmusic.config import UserConfig
from swingmusic.settings import Metadata
from swingmusic.utils.auth import get_current_userid
bp_tag = Tag(name="Settings", description="Customize stuff")
@@ -102,7 +102,11 @@ def get_all_settings():
config[key] = sorted(list(value))
config["plugins"] = [p for p in PluginTable.get_all()]
config["version"] = metadata.version("swingmusic")
config["version"] = Metadata.version
if config["version"] == "0.0.0":
# fallback to version.txt (useful for docker builds)
config["version"] = open("version.txt", "r").read().strip()
# only return lastfmSessionKey for the current user
current_user = get_current_userid()