-
Notifications
You must be signed in to change notification settings - Fork 354
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
Add support for the OriginalDate tag #29
Conversation
Please ignore this for now; I somehow missed that there is an OriginalDate tag, with an equivalent ID3 mapping, which is more useful than OriginalYear. |
657f926
to
858cc36
Compare
Ready for review. |
@@ -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 |
There was a problem hiding this comment.
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.
Fails to build:
This needs to check the libmpdclient version (at compile time). |
Could you please give a further hint at how to do this? Should I check for libmpdclient at one version greater than the currently-released one? |
No, just greater than the current one. |
Ah, of course! I'll fix this stuff up after work today. Thanks. |
858cc36
to
b365ac9
Compare
As you see in my libmpdclient patch I've moved the constants so the binary API doesn't suffer. I also updated configure.ac in my local working copy to have a 2.12.0 version number, reconfigured it and rebuilt and reinstalled. I've switched back and forth between stock 2.11 and this version and tested building MPD both ways. When I was adding the preprocessor version checks I noticed that other such checks use For now I've used the macro, and assumed that 2.12.0 will be the first to support these tags. Please let me know if you'd prefer it done another way. |
@@ -46,6 +46,7 @@ enum TagType | |||
TAG_NAME, | |||
TAG_GENRE, | |||
TAG_DATE, | |||
TAG_ORIGINAL_DATE, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
You're right; while my suggestion was correct, it is more important to use libmpdclient's version check macro, which is not designed to use not-yet-released features. |
@@ -27,6 +27,8 @@ | |||
#include "system/Error.hxx" | |||
#include "Log.hxx" | |||
|
|||
#include <mpd/client.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds a dependency from Haiku on libmpdclient. That's not good!
@@ -395,6 +397,9 @@ HaikuOutput::SendTag(const Tag &tag) | |||
break; | |||
case TAG_GENRE: | |||
case TAG_DATE: | |||
#if LIBMPDCLIENT_CHECK_VERSION(2,12,0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and this condition is unnecessary, because this has nothing to do with libmpdclient.
src/tag/Id3Scan.cxx
Outdated
@@ -55,6 +57,12 @@ | |||
#define ID3_FRAME_ALBUM_ARTIST "TPE2" | |||
#endif | |||
|
|||
#if LIBMPDCLIENT_CHECK_VERSION(2,12,0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. This new tag should always be available, even when not building with libmpdclient.
src/tag/Names.c
Outdated
@@ -20,6 +20,8 @@ | |||
#include "config.h" | |||
#include "Type.h" | |||
|
|||
#include <mpd/client.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and so on... you get the picture?
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.
b365ac9
to
ccb4f44
Compare
Thanks for explaining. I guess I was overcomplicating things! Hopefully I have it looking right this time. |
Thanks!
|
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.