Commit ccb4f44c authored by Bart Nagel's avatar Bart Nagel

Add support for the OriginalDate tag

See https://picard.musicbrainz.org/docs/mappings/ This tag is useful when the user would like all releases of the same album to be sorted next to each other.
parent f85d4d28
......@@ -158,6 +158,9 @@ static constexpr struct {
{ TAG_NAME, MPD_TAG_NAME },
{ TAG_GENRE, MPD_TAG_GENRE },
{ TAG_DATE, MPD_TAG_DATE },
#if LIBMPDCLIENT_CHECK_VERSION(2,12,0)
{ TAG_ORIGINAL_DATE, MPD_TAG_ORIGINAL_DATE },
#endif
{ TAG_COMPOSER, MPD_TAG_COMPOSER },
{ TAG_PERFORMER, MPD_TAG_PERFORMER },
{ TAG_COMMENT, MPD_TAG_COMMENT },
......
......@@ -395,6 +395,7 @@ HaikuOutput::SendTag(const Tag &tag)
break;
case TAG_GENRE:
case TAG_DATE:
case TAG_ORIGINAL_DATE:
case TAG_PERFORMER:
case TAG_COMMENT:
case TAG_DISC:
......
......@@ -55,6 +55,10 @@
#define ID3_FRAME_ALBUM_ARTIST "TPE2"
#endif
#ifndef ID3_FRAME_ORIGINAL_RELEASE_DATE
#define ID3_FRAME_ORIGINAL_RELEASE_DATE "TDOR"
#endif
gcc_pure
static id3_utf8_t *
tag_id3_getstring(const struct id3_frame *frame, unsigned i)
......@@ -317,6 +321,8 @@ scan_id3_tag(struct id3_tag *tag,
handler, handler_ctx);
tag_id3_import_text(tag, ID3_FRAME_YEAR, TAG_DATE,
handler, handler_ctx);
tag_id3_import_text(tag, ID3_FRAME_ORIGINAL_RELEASE_DATE, TAG_ORIGINAL_DATE,
handler, handler_ctx);
tag_id3_import_text(tag, ID3_FRAME_GENRE, TAG_GENRE,
handler, handler_ctx);
tag_id3_import_text(tag, ID3_FRAME_COMPOSER, TAG_COMPOSER,
......
......@@ -32,6 +32,7 @@ const char *const tag_item_names[TAG_NUM_OF_ITEM_TYPES] = {
[TAG_NAME] = "Name",
[TAG_GENRE] = "Genre",
[TAG_DATE] = "Date",
[TAG_ORIGINAL_DATE] = "OriginalDate",
[TAG_COMPOSER] = "Composer",
[TAG_PERFORMER] = "Performer",
[TAG_COMMENT] = "Comment",
......
......@@ -46,6 +46,7 @@ enum TagType
TAG_NAME,
TAG_GENRE,
TAG_DATE,
TAG_ORIGINAL_DATE,
TAG_COMPOSER,
TAG_PERFORMER,
TAG_COMMENT,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment