Skip to content

Commit c91c08f

Browse files
committed
Add mpc status %updateid%
1 parent 044bfe5 commit c91c08f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ Other Commands
470470
%samplerate% The sample rate in Hz extracted from the current MPD audio format.
471471
%bits% The number of significant bits per sample size extracted from the current MPD audio format.
472472
%channels% The number of channels extracted from the current MPD audio format.
473+
%updateid% The current MPD update ID. 0 if there is no update in progress.
473474

474475
================== ======================================================
475476

src/status_format.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ status_value(const struct mpd_status *status, const char *name)
142142
} else {
143143
return NULL;
144144
}
145+
} else if (strcmp(name, "updateid") == 0) {
146+
unsigned update_id = mpd_status_get_update_id(status);
147+
snprintf(buffer, sizeof(buffer), "%i", update_id);
145148
}
146149
else { return NULL; }
147150
return buffer;

0 commit comments

Comments
 (0)