Skip to content

Commit

Permalink
Add mpc status %updateid%
Browse files Browse the repository at this point in the history
  • Loading branch information
kuremu committed Jul 4, 2024
1 parent 044bfe5 commit c91c08f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ Other Commands
%samplerate% The sample rate in Hz extracted from the current MPD audio format.
%bits% The number of significant bits per sample size extracted from the current MPD audio format.
%channels% The number of channels extracted from the current MPD audio format.
%updateid% The current MPD update ID. 0 if there is no update in progress.

================== ======================================================

Expand Down
3 changes: 3 additions & 0 deletions src/status_format.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ status_value(const struct mpd_status *status, const char *name)
} else {
return NULL;
}
} else if (strcmp(name, "updateid") == 0) {
unsigned update_id = mpd_status_get_update_id(status);
snprintf(buffer, sizeof(buffer), "%i", update_id);
}
else { return NULL; }
return buffer;
Expand Down

0 comments on commit c91c08f

Please sign in to comment.