Closed basharovV closed 1 week ago
Hello!
ItemKey::from_key
is confusing and really only used internally. I might make it doc(hidden)
or at least document it better.
So, ItemKey
doesn't retain any format-specific keys. You should be using ItemKey::TrackTotal
and ItemKey::TrackNumber
individually. They will map appropriately when writing the tag.
Ah, thank you for the clarification, I expected lofty to handle the separation here. ItemKey::from_key
is still useful to me though because I already have a dict of the exact ID3v2/Vorbis tags to write, so I thought I could use this function to map without having to do additional format-specific handling. Or is there a better way to handle my use case?
Tag
is intended to be format-agnostic, so you should never have to worry about any format-specific handling. If you have to read/write items that ItemKey
doesn't cover then you should use Id3v2Tag and VorbisComments (and any other concrete format that you have specific keys for). Both can be split (SplitTag) into a Tag
and merged back (MergeTag) into their concrete type
Makes sense! I'll close this issue then. Thanks for this library!
Reproducer
I tried this code:
Output:
Summary
I'm not sure if I'm doing this wrong, but when writing the TRCK tag, I'm seeing some strange behaviour:
tag.track()
isNone
andtag.track_total()
isSome(1)
when TRCK is a single number. Shouldn't this be the other way round?tag.track()
andtag.track_total()
areNone
when providing a delimited TRCK like "1/14"Expected behavior
No response
Assets
No response