Skip to content

Commit

Permalink
Merge branch 'label' of https://github.com/skidoo23/ncmpc
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Sep 11, 2024
2 parents 37b17be + f64f116 commit 236b33c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ncmpc 0.50 - not yet released
* remove option "text-editor-ask"
* lyrics/musixmatch: add new lyrics extension
* lyrics/google: fix partial loading of lyrics
* support MPD 0.22 tag "label" (requires libmpdclient 2.17)

ncmpc 0.49 - (2023-08-04)
* fix UI freeze if lyrics plugin is stuck
Expand Down
3 changes: 3 additions & 0 deletions src/Instance.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ static constexpr TagMask global_tag_whitelist{
MPD_TAG_TRACK,
MPD_TAG_DATE,
MPD_TAG_GENRE,
#if LIBMPDCLIENT_CHECK_VERSION(2,17,0)
MPD_TAG_LABEL,
#endif
MPD_TAG_COMMENT,
};

Expand Down
4 changes: 3 additions & 1 deletion src/SearchPage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static constexpr struct {
{ MPD_TAG_DATE, "date", N_("date") },
{ MPD_TAG_COMPOSER, "composer", N_("composer") },
{ MPD_TAG_PERFORMER, "performer", N_("performer") },
{ MPD_TAG_LABEL, "label", N_("label") },
{ MPD_TAG_COMMENT, "comment", N_("comment") },
{ MPD_TAG_COUNT, nullptr, nullptr }
};
Expand Down Expand Up @@ -92,7 +93,8 @@ static const char *const help_text[] = {
" Example: modified:14d (units: s, M, h, d, m, y)",
"",
" Available tags: artist, album, title, track,",
" name, genre, date composer, performer, comment, file",
" name, genre, date composer, performer, label,",
" comment, file",
"",
};

Expand Down
4 changes: 4 additions & 0 deletions src/SongPage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ static constexpr struct tag_label tag_labels[] = {
{ MPD_TAG_TRACK, N_("Track") },
{ MPD_TAG_DATE, N_("Date") },
{ MPD_TAG_GENRE, N_("Genre") },
#if LIBMPDCLIENT_CHECK_VERSION(2,17,0)
{ MPD_TAG_LABEL, N_("Label") },
#endif
{ MPD_TAG_COMMENT, N_("Comment") },
{ LABEL_PATH, N_("Path") },
{ LABEL_BITRATE, N_("Bitrate") },
Expand Down Expand Up @@ -338,6 +341,7 @@ SongPage::AddSong(const struct mpd_song *song) noexcept
AppendTag(song, MPD_TAG_TRACK);
AppendTag(song, MPD_TAG_DATE);
AppendTag(song, MPD_TAG_GENRE);
AppendTag(song, MPD_TAG_LABEL);
AppendTag(song, MPD_TAG_COMMENT);

AppendLine(get_tag_label(LABEL_PATH), mpd_song_get_uri(song),
Expand Down
2 changes: 2 additions & 0 deletions src/strfsong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ _strfsong(char *const s0, char *const end,
tag = MPD_TAG_WORK;
else if (name == "grouping"sv)
tag = MPD_TAG_GROUPING;
else if (strncmp("%label%", p, n) == 0)
tag = MPD_TAG_LABEL;
#endif
else if (name == "title"sv)
tag = MPD_TAG_TITLE;
Expand Down

0 comments on commit 236b33c

Please sign in to comment.