Skip to content

ID3v2 track & track_total frames are written incorrectly (disk and disk_total probably too) #145

@FriederHannenheim

Description

@FriederHannenheim

Reproducer

I tried this code:

	let mut tagged_file = Probe::open(&opt.path)
		.expect("ERROR: Bad path provided!")
		.read()
		.expect("ERROR: Failed to read file!");

	let tag = tagged_file.primary_tag_mut().unwrap();
        tag.set_track(9);
        tag.set_track_total(13);
        tag.save_to_path(&opt.path).unwrap()

Summary

Track numbers in id3v2 are stored in the TRCK frame, encoded like this {track_number}/{track_total}. Lofty-rs tag currently writes track and track_total as two separate TRCK frames. It looks like this in a hex editor: TRCK.......9TRCK.......13

Suggested fix:

in src/id3/v2/tag.rs on line 763 in tag_frames add special handling for these frames.

Expected behavior

Lofty writing the TRCK frame correctly. Like this: TRCK.......9/13

Assets

ID3v2 Spec (ID3 website is currently broken):
https://web.archive.org/web/20191202011405/http://id3.org/id3v2.4.0-frames

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions