Skip to content

Can not write multiple artists with mp3 and generic Tag #349

Closed

Description

@vnghia

Reproducer

I tried this code:

let mut tag = Id3v2Tag::default();
tag.set_artist(artists.join("\0")); // ["Artist1", "Artist2"]
let mut tag: Tag = tag.into();
tag.save_to_path(&path).unwrap();

// re-read
let tagged_file = read_from_path(&path).unwrap();
let artists = tagged_file.primary_tag().unwrap().
            .get_strings(&ItemKey::TrackArtist)
            .map(std::string::ToString::to_string)
            .collect_vec(); // ["Artists2"]

while this code works:

let mut tag = Id3v2Tag::default();
tag.set_artist(artists.join("\0")); // ["Artist1", "Artist2"]
tag.save_to_path(&path).unwrap();

// re-read
let tagged_file = read_from_path(&path).unwrap();
let artists = tagged_file.primary_tag().unwrap().
            .get_strings(&ItemKey::TrackArtist)
            .map(std::string::ToString::to_string)
            .collect_vec(); // ["Artist1", "Artist2"]

And it seems that this only happens with mp3. I can write multiple artists with vorbis comment on a flac file.

Summary

When converting to generic Tag from Id3v2Tag, multiple artitsts are not preserved.

Expected behavior

When converting to generic Tag from Id3v2Tag, multiple artitsts are preserved.

Assets

No response

Activity

  1. added
    bug
    on Jan 25, 2024
  2. Serial-ATA commented on Jan 25, 2024

    @Serial-ATA
    Owner

    That's an interesting one. Id3v2Tag::merge_tag() handles joining items, but Tag::save_to_path() skips the merging step. The artists are both written, the problem is they end up in different frames, which is not correct. For now, the solution would be to just convert the Tag back to an Id3v2Tag when you are done with it.

  3. added this to the 0.23.0 milestone on Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions