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

Refinements and Enhancements #9

Open
J-P- opened this issue Jun 9, 2016 · 1 comment
Open

Refinements and Enhancements #9

J-P- opened this issue Jun 9, 2016 · 1 comment
Assignees

Comments

@J-P-
Copy link

J-P- commented Jun 9, 2016

These are not issues, per se, rather requests. Thanks in advance.

  1. Add a modifier, such as a semicolon, to append to keys which allow multiple lines or values (GENRE, COMMENT, POPM, …), as opposed to replacing any value previously set with the the new. See the example in the next item.

  2. Add support writing POPM. I suggest:
    "POPM":"johndoe@RATED.COM:192:62"

E.g., to replace current POPM values:
id3 -2 -wPOPM "johndoe@RATED.COM:2:62" …

E.g., to append to current POPM, i.e., add a second:
id3 -2 -wPOPM ";janedoe@RATED.COM:2:4" …

  1. Replace line feed with Unicode (U+000D/U+000A) or PCRE (\R) representatives. This will allow writing multi-line COMM values. The \R matches the user's environment, \r\n or \n.

  2. These all pertain to the verbose output (dump) and write options. I suggest modifying the format a little, allowing the output to a file in a standard way and reading in the same file.

a) I suggest "a key and value on one line" format for the metadata dump file (a little JSON-ish). Note that for key which allow multiple lines or values (GENRE, COMMENT, POPM, …), a prefixed semicolon appends attached value as opposed to swapping the attached new with any previously set.


{
    "id3mt": "0.81",
    "file_name": "test.mp3",
    "metadata": "ID3v2.3",
    "TIT2": "08—THIS TOWN",
    "TPE1": "06—FRANK SINATRA",
    "TALB": "02—ALBUM",
    "TRCK": "19",
    "TORY": "2003",
    "TCON": "GENRE1;GENRE2",
    "TCON": ";GENRE3",
    "TEXT": "18—LYRICIST",
    "TPE4": "16—MIXER",
    "TOAL": "21—ALBUMORIG",
    "TOPE": "23—ARTISTORIG",
    "TOLY": "28—LYRICISTORIG",
    "TSO2": "51—ALBUMARTISTSORT",
    "TXXX:ASIN": "24000078",
    "TXXX:BAND": "14—BAND",
    "TXXX:CATALOGNUMBER": "26—CATALOGNO",
    "TXXX:itunesadvisory": "4",
    "TXXX:TEST3": "60—TEST",
    "COMM::eng": "13—COMMENT_LINE1U+000DU+000A13—COMMENT_LINE2U+000DU+000A13—COMMENT_LINE3U+000DU+000A",
    "POPM":"johndoe@RATED.COM:192:62",
    "POPM":";janedoe@RATED.COM:1:2"
}

b) Provide a means to output a dump file from an audio file. For example,
id3 -2 -vf test.mp3 >>> test.tags … with contents as (a) above.
I realize that a users can currently do: id3 -v test.mp3 > test.tags

c) Provide a means to input a dump file to an audio file. For example,
id3 -2 -wf test.mp3 >>> uses contents of test.tags, or explicitly specify dump file,
id3 -2 -wf "test.tags" test.mp3

@squell
Copy link
Owner

squell commented Jun 5, 2017

  1. "Appending" is a bit ambiguous in ID3v2. You can have multiple COMM frames in a tag (as long as they have unique descriptors), and each COMM frame can also have multiple lines. I can imagine mp3 playing software blurring this distinction.

    • Appending content to an existing frame is already supported, since you can use something like:

    id3 -2wCOMM:descr:eng "%{COMM:descr:eng}\nJ-P was here!"

    Which could be made a bit nicer, indeed, by introducing a meta-variable for the previous value (I don't what would be a nice pick here, perhaps %&)

    • Adding a new COMM frame requires providing a descriptor, e.g.

    id3 -2wCOMM:bragging:eng "J-P- was here!"

    But in this case you're not really appending to anything, just adding new information.

  2. Great suggestion. If I read the ID3v2 spec, the email-adress is part of the key of the frame, so the syntax should become -wPOPM:johndoe@rated.com 2:62, which can then be queried using %{POPM:johndoe@rated.com}

  3. Not sure what you mean here: ID3v2 appears to require multiple lines in supported fields to be seperated by newlines, so \n should give you support for multiple lines.

  4. There are two issues here; reading the dump, and the output format of this dump.

    • Reading the dump is on the TODO list; as is adding support for
      piping such a dump through an external editor/tool, and then reading it back again.

    • The current 'verbose' format was designed to be close to the actual binary representation and to be friendly for bash/sed/vim; and also to be useful (hopefully) as an intermediate representation for conversion more well-defined formats (such as JSON/YAML/XML...).

    So, an easiest way to add JSON output would be by writing a seperate script that transforms the output of id3 -v to JSON (and back again, once I've added reading dumps). This is also something that is probably best implemented in a higher level scripting language instead of C++. Help in this area is appreciated as I'm not a JSON/YAML/XML/etc. expert.

@squell squell self-assigned this Jun 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants