Skip to content

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

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

Closed
FriederHannenheim opened this issue Feb 14, 2023 · 1 comment · Fixed by #149
Labels
bug Something isn't working

Comments

@FriederHannenheim
Copy link
Contributor

FriederHannenheim commented Feb 14, 2023

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

@FriederHannenheim FriederHannenheim added the bug Something isn't working label Feb 14, 2023
@FriederHannenheim
Copy link
Contributor Author

FriederHannenheim commented Feb 14, 2023

I would like to volunteer to fix this. Just let me know if my suggested fix looks good to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant