Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c2a45cd
fix: Drop a terminating NUL from ID3 text
decriptor Nov 20, 2026
791faa7
fix: Keep multi-value fields when a tag is copied
decriptor Nov 20, 2026
6dcd383
fix: Keep every APE name and the first ID3 value
decriptor Nov 21, 2026
8c8e23a
fix: Read the first APE name and drop the stale album-artist item
decriptor Nov 21, 2026
033b365
fix: Keep fallback tag fields in step with the value that is read
decriptor Nov 21, 2026
513a15f
fix: Prefer a text album artist over a locator in the other item
decriptor Nov 21, 2026
ae6e4be
fix: Clear every ID3 frame a date or movement getter can read
decriptor Nov 21, 2026
7de58c5
test: Pin the MVIN half a movement number or total clear keeps
decriptor Nov 21, 2026
e024c56
fix: Keep the fallback field when a value is written back
decriptor Nov 21, 2026
970f336
docs: Describe the ID3 movement frames and fallback writes
decriptor Nov 21, 2026
f422454
test: Pin the TXXX movement number a total clear keeps
decriptor Nov 21, 2026
6c3db68
fix: Make a write-back of any single-value field a no-op
decriptor Nov 21, 2026
a5f248d
docs: Describe the write-back rule for single-value names
decriptor Nov 21, 2026
4c0a6d5
fix: Let CopyTo replace a list and "" clear one with text
decriptor Nov 21, 2026
a971fad
docs: Say that CopyTo replaces and when an empty string clears
decriptor Nov 21, 2026
a439d65
fix: Keep a fallback field when CopyTo writes the value it holds
decriptor Nov 21, 2026
639267c
docs: Note that a copy keeps a fallback field of its own
decriptor Nov 21, 2026
c576263
fix: Read the first non-empty value and copy from a snapshot
decriptor Nov 21, 2026
5722d54
docs: State the first-value, copy, and Picard movement rules
decriptor Nov 21, 2026
12ccf12
fix: Match views by their tags and map movements as Picard does
decriptor Nov 21, 2026
b568ed3
docs: State the view, comment, and movement rules and the reader diff…
decriptor Nov 21, 2026
cb72268
fix: Store the first non-empty name when a list meets one name
decriptor Nov 22, 2026
36f5075
docs: Correct the clear, APE text, and view-copy statements
decriptor Nov 22, 2026
8db19bc
fix: Name the AIFF view's tag and keep ID3v2 values as written
decriptor Nov 22, 2026
0477a14
docs: Say that ID3v2 list values are kept as written
decriptor Nov 22, 2026
55481a0
test: Classify every Tag type as a leaf or a view that names its tags
decriptor Nov 22, 2026
58cc3d5
docs: State the slash split and that an empty copied value clears
decriptor Nov 22, 2026
4fe8724
test: Require each view to declare Leaves and list leaf tags by full …
decriptor Nov 22, 2026
2c5b459
test: Move the Tag type classification into a shared test helper
decriptor Nov 22, 2026
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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Matroska: `DiscNumber` and `TotalDiscs` are read and written (#130). Setting or clearing a track or disc number or total leaves the other three as they were, including a total held in a `4/12` or `2/3` slash, and a clear removes every element the getter could still read.
- Matroska: every rendered Tag has a `Targets` element. An omitted `TargetTypeValue` is not written back as 50, and an empty one reads as the default 50. A Tag that a clear leaves with no SimpleTag is not written (RFC 9559 section 5.1.8.1.2); one that was already empty when read is kept.

### Changed

- An APE artist, album artist, composer, or genre is the first name. It is not a comma-joined string. A Basic copy from APE into MP4, ASF, RIFF INFO, or ID3v1 keeps that first name. A copy into ID3v2 keeps the full list.
- A single-value ID3v2 or Vorbis Comment property, and an APE artist, album artist, composer, or genre, returns the first non-empty value, and an empty string only when every value is empty. Other APE text items still read every non-empty value joined with ", " (`A\0B` reads "A, B"). So do the public `Id3v2Tag.GetTextFrame`, `Id3v2Tag.GetUserText`, and `VorbisComment.GetValue`, and the ID3v2 comment and lyrics, which read the first non-empty frame without a description, then the first other one. ID3v2.4 §4.2 stores several strings as a NUL-separated list and Vorbis field names may repeat, so `"\0V2"` and `ARTIST=` + `ARTIST=V2` read `V2`. A value is kept as written: only an empty value is skipped, so `" \0B"` reads `" "`, as other readers show it. `Id3v2Tag.GetTextFrameValues` and the ID3v2 list properties no longer trim or drop blank NUL-separated values, so for NUL-separated values the single value and the first list entry agree. A value with `/` and no NUL is still split on `/` and trimmed, in any ID3v2 version, so `AC/DC` reads Artist `AC/DC` and Performers [`AC`, `DC`], as before. This replaces the earlier reading of a leading NUL as an empty first value, and it differs from mutagen and TagLib#, which return the empty first ID3v2 value; for a comment it matches what ffprobe and TagLib# show. Writing back the value read changes nothing, so a multi-value frame, item, or repeated field keeps every value. `= ""` clears: it removes the ID3v2 frame (for a comment or lyrics, every frame without a description) or the APE item, and leaves one empty Vorbis field. The comparison is ordinal, so a case-only edit still writes, and `null` clears like `= ""`. For an ID3v2 comment or lyrics, both remove only the frames without a description; a described comment or lyrics frame (such as `ID3v1 Comment`) is then still read, as before. This covers every ID3v2 string property (every text and TXXX frame, the year, the podcast feed URL, the MusicBrainz recording ID, the comment and the lyrics, and the movement number and total), every APE text property, and every Vorbis text field.
- `CopyTo` reads every source value before it writes any. It replaces the target's list with the source value, even when that equals the target's first value. A list (performers, album artists, composers, genres, and the sort and role lists) that the target already holds is left as it is, and with `Extended` the artist and genre travel in those lists, so a `Basic` copy alone is what writes a single name over a list. When the source and target read from a common tag (a tag copied into itself, or a file's combined `Tag` copied into one of its own tags or into another view over them, as two reads of `Mp3File.Tag` are), the copy only adds values the target does not show. An empty source value still clears the field, as `= ""` does, so through a view it also clears what the view showed from another tag (an ID3v1 title, an AIFF `NAME` chunk). So `mp3.Id3v2Tag.CopyTo (mp3.Tag)` no longer rewrites the ID3v1 tag with values the combined view already shows from ID3v2. A fallback field of its own beside a value equal to the copied one stays: Vorbis `ORIGINALYEAR`, APE `Date`, and the ID3v2.3 `TDOR` beside `TORY`. Pictures are outside these rules: a non-empty source picture list always replaces the target's, as before.
- A list copied into a tag that holds one name (MP4, ASF, RIFF INFO, ID3v1, or the base `Tag` list setters) stores its first non-empty entry, not an empty first entry. A copy of `ARTIST=` + `ARTIST=V2` into an MP4, WAV, or WMA file stores `V2`, as a `Basic` copy already did, instead of clearing the artist and genre.
- Vorbis and APE movements follow MusicBrainz Picard's tag mapping: the name is `MOVEMENTNAME` and the number is `MOVEMENT` (`MOVEMENTNUMBER` is still read first and kept in step). A new name is written to `MOVEMENTNAME` and a new number to `MOVEMENT`, where the name went to `MOVEMENT` and the number to `MOVEMENTNUMBER` before. A `MOVEMENT` that is not a number is still read as the name when there is no `MOVEMENTNAME`, and is kept in step with a new name; a numeric name then goes to `MOVEMENTNAME` only. Clearing one half never changes how the other half reads, and a copy from a Picard FLAC no longer writes the number "2" over an ID3v2 `MVNM`.
- Clearing an APE year also removes `Date`, and setting a new year also writes it to an existing `Date`. A locator reads as the same string a title locator reads. An empty text item reads as an empty string, and a binary item reads as null, for a name and for a title.
- Clearing a Vorbis original release date also removes `ORIGINALYEAR`, and setting a new date rewrites an existing `ORIGINALYEAR` to its four-digit year. Writing back the APE year, Vorbis original release date, or movement already read changes nothing, so a Picard or Mp3tag tag keeps every field. An empty `Year` or `ORIGINALDATE` no longer hides a filled `Date` or `ORIGINALYEAR`; the same holds for an empty ID3v2 `MVNM`, and for a `TDOR` or `TORY` that holds no date.
- An ID3v2 movement write now also stores the name in Apple's `MVNM` frame, and a movement number or total also updates `MVIN`, keeping the other half. Clearing removes those frames too.
- Setting a new ID3v2 original release date, or clearing it, removes both `TDOR` and `TORY`, then writes the frame for the tag's version, so the other version's frame cannot come back. Writing back the date already read changes nothing.

## [0.6.0] - 2026-01-05

### Breaking Changes
Expand Down
14 changes: 14 additions & 0 deletions src/TagLibSharp2/Aiff/AiffTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -501,5 +501,19 @@ public override BinaryData Render () =>

Id3v2Tag? Id3 => _file.Id3v2Tag;

/// <inheritdoc/>
/// <remarks>
/// This view reads the file's ID3 tag, so a copy between it and that tag (or another view over the
/// same file) only adds values the target does not show.
/// </remarks>
internal override IEnumerable<Tag> Leaves ()
{
yield return this;
if (Id3 is { } id3) {
foreach (var leaf in id3.Leaves ())
yield return leaf;
}
}

Id3v2Tag Ensure () => _file.EnsureId3 ();
}
Loading
Loading