From 3acbab15a183f712d8ed3b3a073c92dbf42c17fd Mon Sep 17 00:00:00 2001 From: "James D. Smith" Date: Wed, 15 Sep 2021 20:51:22 -0600 Subject: [PATCH] File properties plugin: Add composer. Change-Id: I7123ad21af15483594b9d247b89f7712c3a1a6f0 --- apps/lang/english.lang | 14 ++++++++++++++ apps/plugins/properties.c | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 7d0d940b91..0f5bf23e9a 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -15996,3 +15996,17 @@ *: "Comment" + + id: LANG_PROPERTIES_COMPOSER + desc: in properties plugin + user: core + + *: "[Composer]" + + + *: "[Composer]" + + + *: "Composer" + + diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c index bc892a4464..07a953c432 100644 --- a/apps/plugins/properties.c +++ b/apps/plugins/properties.c @@ -33,6 +33,7 @@ char str_date[64]; char str_time[64]; char str_title[MAX_PATH]; +char str_composer[MAX_PATH]; char str_artist[MAX_PATH]; char str_albumartist[MAX_PATH]; char str_album[MAX_PATH]; @@ -54,6 +55,7 @@ static const unsigned char* const props_file[] = ID2P(LANG_PROPERTIES_SIZE), str_size, ID2P(LANG_PROPERTIES_DATE), str_date, ID2P(LANG_PROPERTIES_TIME), str_time, + ID2P(LANG_PROPERTIES_COMPOSER), str_composer, ID2P(LANG_PROPERTIES_ARTIST), str_artist, ID2P(LANG_PROPERTIES_ALBUMARTIST), str_albumartist, ID2P(LANG_PROPERTIES_TITLE), str_title, @@ -123,6 +125,8 @@ static bool file_properties(const char* selected_file) rb->get_metadata(&id3, fd, selected_file)) { long dur = id3.length / 1000; /* seconds */ + rb->snprintf(str_composer, sizeof str_composer, + "%s", id3.composer ? id3.composer : ""); rb->snprintf(str_artist, sizeof str_artist, "%s", id3.artist ? id3.artist : ""); rb->snprintf(str_albumartist, sizeof str_albumartist, @@ -135,7 +139,7 @@ static bool file_properties(const char* selected_file) "%s", id3.genre_string ? id3.genre_string : ""); rb->snprintf(str_comment, sizeof str_comment, "%s", id3.comment ? id3.comment : ""); - num_properties += 6; + num_properties += 7; if (dur > 0) {