video Tools: server-prefix the scan title (Plex/Jellyfin Library Scan)
Dashboard endpoint now returns the active media server; the Tools card title becomes '<Server> Library Scan' (e.g. 'Plex Library Scan'), matching how music prefixes 'Plex Database Updater'.
This commit is contained in:
parent
b5d0b76fe6
commit
a5ff4a1dd8
3 changed files with 14 additions and 2 deletions
|
|
@ -18,7 +18,13 @@ def register_routes(bp):
|
|||
def video_dashboard():
|
||||
from . import get_video_db
|
||||
try:
|
||||
return jsonify(get_video_db().dashboard_stats())
|
||||
stats = get_video_db().dashboard_stats()
|
||||
try:
|
||||
from config.settings import config_manager
|
||||
stats["server"] = config_manager.get_active_media_server()
|
||||
except Exception:
|
||||
stats["server"] = None
|
||||
return jsonify(stats)
|
||||
except Exception:
|
||||
logger.exception("Failed to build video dashboard stats")
|
||||
return jsonify({"error": "Failed to load video dashboard stats"}), 500
|
||||
|
|
|
|||
|
|
@ -761,7 +761,7 @@
|
|||
<div class="tools-grid">
|
||||
<div class="tool-card">
|
||||
<div class="tool-card-header">
|
||||
<h4 class="tool-card-title">Library Scan</h4>
|
||||
<h4 class="tool-card-title" data-video-scan-title>Library Scan</h4>
|
||||
<button class="tool-help-button" data-tool="video-scan" title="Learn more about this tool">?</button>
|
||||
</div>
|
||||
<p class="tool-card-info">Last Scan: <span data-video-scan-last>Never</span></p>
|
||||
|
|
|
|||
|
|
@ -65,6 +65,12 @@
|
|||
set('shows', lib.shows || 0);
|
||||
set('episodes', lib.episodes || 0);
|
||||
set('size', formatSize(lib.size_bytes));
|
||||
// Server-prefixed title, like music ("Plex Database Updater").
|
||||
var titleEl = document.querySelector('[data-video-scan-title]');
|
||||
if (titleEl && d.server) {
|
||||
titleEl.textContent =
|
||||
d.server.charAt(0).toUpperCase() + d.server.slice(1) + ' Library Scan';
|
||||
}
|
||||
})
|
||||
.catch(function () { /* leave defaults */ });
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue