mirror of
https://github.com/SuperBFG7/ympd
synced 2025-01-14 19:25:49 +00:00
MPD Version in About Modal
This commit is contained in:
parent
b5cfb3512f
commit
3353715d9e
@ -558,6 +558,7 @@
|
|||||||
<h5>Play Statistics</h5>
|
<h5>Play Statistics</h5>
|
||||||
<table class="table table-sm">
|
<table class="table table-sm">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr><th>MPD Version</th><td id="mpdVersion"></td></tr>
|
||||||
<tr><th>Uptime</th><td id="mpdstats_uptime"></td></tr>
|
<tr><th>Uptime</th><td id="mpdstats_uptime"></td></tr>
|
||||||
<tr><th>Play Time</th><td id="mpdstats_playtime"></td></tr>
|
<tr><th>Play Time</th><td id="mpdstats_playtime"></td></tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -658,6 +658,7 @@ function webSocketConnect() {
|
|||||||
var d = new Date(obj.data.dbupdated * 1000);
|
var d = new Date(obj.data.dbupdated * 1000);
|
||||||
$('#mpdstats_dbupdated').text(d.toUTCString());
|
$('#mpdstats_dbupdated').text(d.toUTCString());
|
||||||
$('#mympdVersion').text(obj.data.mympd_version);
|
$('#mympdVersion').text(obj.data.mympd_version);
|
||||||
|
$('#mpdVersion').text(obj.data.mpd_version);
|
||||||
break;
|
break;
|
||||||
case 'error':
|
case 'error':
|
||||||
showNotification(obj.data,'','','danger');
|
showNotification(obj.data,'','','danger');
|
||||||
|
@ -1071,6 +1071,11 @@ int mympd_get_stats(char *buffer)
|
|||||||
char *cur = buffer;
|
char *cur = buffer;
|
||||||
const char *end = buffer + MAX_SIZE;
|
const char *end = buffer + MAX_SIZE;
|
||||||
struct mpd_stats *stats = mpd_run_stats(mpd.conn);
|
struct mpd_stats *stats = mpd_run_stats(mpd.conn);
|
||||||
|
const unsigned *version = mpd_connection_get_server_version(mpd.conn);
|
||||||
|
char mpd_version[20];
|
||||||
|
|
||||||
|
snprintf(mpd_version,20,"%i.%i.%i", version[0], version[1], version[2]);
|
||||||
|
|
||||||
if (stats == NULL)
|
if (stats == NULL)
|
||||||
RETURN_ERROR_AND_RECOVER("mympd_get_stats");
|
RETURN_ERROR_AND_RECOVER("mympd_get_stats");
|
||||||
cur += json_emit_raw_str(cur, end - cur, "{\"type\":\"mpdstats\",\"data\": {");
|
cur += json_emit_raw_str(cur, end - cur, "{\"type\":\"mpdstats\",\"data\": {");
|
||||||
@ -1090,6 +1095,8 @@ int mympd_get_stats(char *buffer)
|
|||||||
cur += json_emit_int(cur, end - cur, mpd_stats_get_db_play_time(stats));
|
cur += json_emit_int(cur, end - cur, mpd_stats_get_db_play_time(stats));
|
||||||
cur += json_emit_raw_str(cur, end - cur, ",\"mympd_version\":");
|
cur += json_emit_raw_str(cur, end - cur, ",\"mympd_version\":");
|
||||||
cur += json_emit_quoted_str(cur, end - cur, MYMPD_VERSION);
|
cur += json_emit_quoted_str(cur, end - cur, MYMPD_VERSION);
|
||||||
|
cur += json_emit_raw_str(cur, end - cur, ",\"mpd_version\":");
|
||||||
|
cur += json_emit_quoted_str(cur, end - cur, mpd_version);
|
||||||
cur += json_emit_raw_str(cur, end - cur, "}}");
|
cur += json_emit_raw_str(cur, end - cur, "}}");
|
||||||
|
|
||||||
mpd_stats_free(stats);
|
mpd_stats_free(stats);
|
||||||
|
Loading…
Reference in New Issue
Block a user