Repository navigation
fix: Return an AIFF annotation as the comment - #135
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #135 +/- ##
==========================================
+ Coverage 92.97% 93.02% +0.04%
==========================================
Files 293 298 +5
Lines 58521 59830 +1309
Branches 5632 5862 +230
==========================================
+ Hits 54410 55654 +1244
+ Misses 2418 2395 -23
- Partials 1693 1781 +88 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
decriptor
force-pushed
the
fix/aiff-comment
branch
from
November 21, 2026 19:39
d57e413 to
3631058
Compare
Owner
Author
|
Review: 0 findings at 007684c. All findings from the earlier review rounds are fixed, and the last round found nothing new. What was checked at this head:
|
A FORM AIFF may contain more than one ANNO chunk and more than one COMT chunk. The first was kept and the rest were dropped. A trailing NUL counted inside a COMT string is not part of the comment. Fixes #127
The COMT text count includes one leading space before Creator: Logic. A trailing space in the text stays. Fixes #127
Comment, title, artist, and copyright prefer a non-empty ID3 field and otherwise the native chunk. Save rewrites each model from itself, so clearing a comment does not restore COMT or ANNO text.
A comment, title, artist, or copyright set by the caller is stored on the ID3 tag, including a comment longer than a COMT field and a file that already has lyrics or a rating. Native chunks are kept only for text read from those chunks and not overridden, and rewritten text uses Mac OS Roman. The combined tag is a cached get-only view that forwards the rest of the Tag surface.
Walk every settable Tag member through the AIFF view, a WAV save and Id3v2Tag.IsEmpty so a member that stops forwarding or an ID3 tag that saves as empty fails a test. Bound the many-ANNO read by allocated bytes instead of wall-clock time, and cover each UTF-8 lead-byte class, including a sequence cut off at the end of the chunk.
…write A comment edit re-encoded the notes of other markers from their decoded text, so a UTF-8 note became Mac OS Roman and a trailing NUL was lost. Write each note's bytes as read. Every edit already moves the field to ID3, so the native rewrite branches, the Mac OS Roman encoder and the save-time InvalidOperationException catch had nothing left to handle. Remove them and say in the remarks that ID3 is the only write target.
List the AiffFile.Tag type change and the wider Id3v2Tag.IsEmpty as breaking changes, and show AIFF's native chunks in the README table.
…otes A comment edit or Clear rewrote COMT from the notes it had read, but notes with no text or only NULs were never kept, so they were lost. Keep every note for a marker other than 0. Write at most 65,535 notes per COMT chunk so numComments cannot wrap, and report TagType from the same fields as IsEmpty, so marker notes alone are not a tag.
…ment-edit guard Split notes from several COMT chunks over the fewest chunks that hold them, evenly, so a chunk is full only when the input's were (MediaInfo 26.10 hangs on a count of 65,535). Cite the Comments Chunk rule instead of a section that does not exist, and test that a save without a comment edit keeps every COMT chunk byte for byte.
… must Use min(ceil(n / 65,534), input COMT chunks) chunks. That still never writes more chunks than the file had, and writes a count of 65,535 only when the notes do not fit 65,534 to a chunk. Pin the split at the 65,535 and 131,070 boundaries and on three- and four-chunk inputs.
decriptor
force-pushed
the
fix/aiff-comment
branch
from
November 22, 2026 01:51
007684c to
5fd0ac6
Compare
Owner
Author
|
Review: 0 findings at 5fd0ac6 (rebase of the approved 007684c onto main b2887cd). What was checked:
|
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AIFF comments, titles, artists and copyrights come from the native text chunks without being copied into ID3, and later edits go to ID3.
Breaking change.
AiffFile.Tagwas a settableId3v2Tag?. It is now a get-onlyTag?view over the ID3 chunk and the native chunks. The ID3 tag itself is the newAiffFile.Id3v2Tagproperty (get and set). Code that assignedaiff.Tag, or used ID3-only members on it, has to move toaiff.Id3v2Tag.aiff.Tag.Render()throwsNotSupportedException, like the other combined views; render theAiffFile. The CHANGELOG lists this under Breaking Changes.Read. Comment, Title, Artist and Copyright return the ID3 value when it is non-empty, otherwise the native
ANNO/COMT,NAME,AUTHor(c)text. ACOMTentry with marker id 0 is the file comment and ranks aboveANNO. Entries for other marker ids are not the file comment. Every otherTagmember is forwarded to the ID3 tag. Native text is Mac OS Roman, or UTF-8 when the whole value is valid UTF-8 and contains a multibyte sequence. A leading space is kept, soTOS_DVDSTEREOMIX.aifreadsCreator: Logic. Duration stays 734.000 seconds. The sound data is not loaded.TagTypereports native text asRiffInfo, becauseTagTypeshas no AIFF member.Write. Any set of Title, Artist, Comment, Copyright or Performers writes ID3 and removes that field's native chunks on save. That includes a native-only field and a set to the value it already has, so a reader that only looks at
NAME/ANNO/COMTno longer sees an edited field. Native chunks are never rewritten. When a comment edit removes aCOMTfile comment, the notes for other markers stay inCOMTbyte for byte. A comment over 64 KB and a file that already has lyrics both save. Clearing a field stays cleared. An unchanged save does not add an ID3 chunk and keeps the native chunks as they are.Also changes WAV.
Id3v2Tag.IsEmptynow checks every frame kind, not only the basic fields. WAV and AIFF write the ID3 chunk only when it is not empty, so a WAV save used to drop an ID3 tag that held only, for example, a composer, a publisher, lyrics or a BPM. It now keeps it.Fixes #127