Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the OriginalDate tag #29

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/db/plugins/ProxyDatabasePlugin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
1 change: 1 addition & 0 deletions src/output/plugins/HaikuOutputPlugin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions src/tag/Id3Scan.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some ID3 tag identifiers are in definitions up here, others aren't. I wasn't sure which style to mimic. Also, some definitions are indented, others are not; ditto.


gcc_pure
static id3_utf8_t *
tag_id3_getstring(const struct id3_frame *frame, unsigned i)
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/tag/Names.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/tag/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ enum TagType
TAG_NAME,
TAG_GENRE,
TAG_DATE,
TAG_ORIGINAL_DATE,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to get a preprocessor check here without getting an error. If this line of code needs a check, please help me with it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would this need a preprocessor check? This is MPD's internal definition, not one imported from libmpdclient (which in turn mirrors MPD's internal definitions to use MPD's features).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know the answer; I wasn't sure where it would be needed and where it would not, and was trying to err on the side of caution. C++ is not my strong suit.

TAG_COMPOSER,
TAG_PERFORMER,
TAG_COMMENT,
Expand Down