Skip to content

Commit

Permalink
feat(mpris2): add lyrics to metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
onegentig committed Jul 20, 2024
1 parent ea90af7 commit 35fefae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mpris2/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct MPRIS2Metadata
String genre;
String rec_date;
String composer;
String lyrics;
String file;
int32_t track = -1;
int64_t length = -1;
Expand Down Expand Up @@ -171,6 +172,7 @@ static void update_metadata (void * data, GObject * object)
meta.comment = tuple.get_str (Tuple::Comment);
meta.genre = tuple.get_str (Tuple::Genre);
meta.composer = tuple.get_str (Tuple::Composer);
meta.lyrics = tuple.get_str (Tuple::Lyrics);
meta.track = tuple.get_int (Tuple::Track);
meta.length = tuple.get_int (Tuple::Length);
meta.disc = tuple.get_int (Tuple::Disc);
Expand Down Expand Up @@ -215,6 +217,8 @@ static void update_metadata (void * data, GObject * object)
add_g_variant_str ("xesam:contentCreated", meta.rec_date, elems);
if (meta.composer)
add_g_variant_arr_str ("xesam:composer", {meta.composer}, elems);
if (meta.lyrics)
add_g_variant_str ("xesam:asText", meta.lyrics, elems);
if (meta.file)
add_g_variant_str ("xesam:url", meta.file, elems);
if (meta.track > 0)
Expand Down

0 comments on commit 35fefae

Please sign in to comment.