Še malo šminke (št. pesmi) in 9900 za prikaz istega preko tipkovnice. #9

This commit is contained in:
2026-03-27 21:37:34 +01:00
parent f75a6f04dd
commit c80bebe1f0
3 changed files with 58 additions and 0 deletions

View File

@@ -207,6 +207,13 @@ def get_app_info():
# appinfo.json je v korenskem imeniku projekta
with open('appinfo.json', 'r', encoding='utf-8') as f:
info = json.load(f)
# Dodaj število pesmi v bazi
if _projector_app is not None:
_projector_app.cursor.execute("SELECT COUNT(*) FROM songs")
count = _projector_app.cursor.fetchone()[0]
info['song_count'] = count
return jsonify(info)
except Exception as e:
return jsonify({'error': str(e)}), 500

View File

@@ -362,6 +362,11 @@ async function openAbout() {
document.getElementById('about-name').textContent = data.name;
document.getElementById('about-version').textContent = 'Verzija ' + data.version;
document.getElementById('about-description').textContent = data.description;
// Dodaj število pesmi
if (data.song_count !== undefined) {
document.getElementById('about-description').innerHTML += `<br><br>Število pesmi v bazi: <strong>${data.song_count}</strong>`;
}
const authorsList = document.getElementById('about-authors');
authorsList.innerHTML = '';