Add support for new iTunes GRP1 field

Create issue
Issue #180 new
IJabz repo owner created an issue

For ID3 only ITunes now uses this new GRP1 field for storing groupings rather than TIT1 which it now uses for Works

Comments (13)

  1. IJabz reporter

    This is very much iTunes specific currently so should be labellled as such. Not sure how/if to deal with at generic level since only applies to ID3 formats, but we dont want users to have to use ID3 specific frames if at all possible,may have to do something with isSupported()

  2. Hendrik Schreiber

    Yep. Looks like iTunes now maps grouping to GRP1 and work to TIT1. Fun.

    IMO, it would be nice, if there was simple support for GRP1, perhaps under ID3v24FieldKey (and other v2 fieldkeys) as ITUNES_GROUPING?

  3. IJabz reporter

    Yes, it is very ID3v2 specific and I don't want to redefine the existing Grouping mapping so I think yes this may just be a change for ID3, but the trouble is then code has to specifically use the ID3 api I would like them to to be able to use the generic api, even if they have to do if(file.isMP3()) first

  4. Hendrik Schreiber

    I guess that means, adding ITUNES_GROUPING to FieldKey as well (along with the required mappings)?

  5. IJabz reporter

    Yes but all other formats do not have a separate GROUPING and ITUNES_GROUPING are our logic does not support mapping two FieldKey to the same format specific key

  6. Hendrik Schreiber

    GROUPING could still be mapped to TIT1 (just like before). ITUNES_GROUPING could be mapped to GRP1 for mp3 and nowhere for other formats.

    So if a user wants to set this field, s/he needs to know, whether she wants to write to GRP1 or TIT1.

    Other than this solution, we could think about an iTunes 12.6 mode and a regular mode.

    In iTunes 12.6 mode, GROUPING is always mapped to GRP1 and WORK is always mapped to TIT1. In regular mode, GROUPING is mapped to TIT1 and WORK is mapped to a TXXX field.

    Isn't there this class TagOptionSingleton that could handle this?

  7. Hendrik Schreiber

    I'm very interested in getting this done in the next couple of days, but would rather coordinate with you before implementing stuff blindly. Please let me know, what you think!

    Thank you.

  8. IJabz reporter

    HI, okay I think adding something to TagOptionSingleton is a good way to go, whether it needs to map both Work and Grouping Im not sure since in my code I always write Work to TXXX:WORK and then additionally allow to write to TIT1 if iTunes option enabled, have a go and we can review it.

  9. Hendrik Schreiber

    Just sent you a pull request.

    The changes basically mean:

    • You can switch between two modes (iTunes 12.6 or regular)
    • You can so so via a method in TagOptionSingleton
    • Switching only makes sense before you do anything else.
    • All it does is change the mapping of FieldKey.GROUP and WORK to GRP1 and TIT1.
    • So when in iTunes mode, things work seamlessly with iTunes 12.6, because the behavior is identical.

    Sounds good?

  10. Hendrik Schreiber

    Ive merged it in. I also added a test for AIF and WAV files so I can confirm it also has an effect on AIF which is right, but it also effects WAV fiels which I think is wrong (although not sure) since iTunes doesnt understand WAV metadata

    I guess there are two use-cases:

    1. You want to be compatible with iTunes 12.6
    2. You don't care about iTunes and want things to stay the way they were

    In case 1 you always want to write data in a way that iTunes understands. It really does not matter how you write to WAV, because iTunes does not know how to read or write ID3 metadata from WAVs.

    In case 2 you always want to write the same way. What iTunes makes of this does not matter. Here you get neat "old-style" tags in all the formats. I.e. ID3 in its various containers and whatever else you have.

    So in essence you have to choose which path you want to go down. PR50 lets you do that.

  11. Hendrik Schreiber

    In PR 50 I wrote:

    For AIFF, iTunes 12.6 seems to write GROUPING to GP1. Work and movement don't not seem to be written at all.

    I checked this again and it is true: As far as I can see, iTunes does not embed work or movement info into the AIFF ID3 tag. I checked this with iTunes 12.6.1.25 on OS X 10.10.5 using a hex editor (i.e. actually looking into the binary file).

    I have filed a bug with Apple (radar 32461134).

  12. Hendrik Schreiber

    FYI: Apple reacted to my bug report:

    Engineering has determined that your bug report (32461134) is a duplicate of 3085538 and will be closed.

    So I guess there is hope that they will fix this at some point. In theory, they'll notify me.

  13. Log in to comment