mirror of
https://github.com/taglib/taglib.git
synced 2026-02-13 11:43:06 -05:00
Consistently handle invalid and deprecated tags in setProperties()
This commit reverts the use of strip() in setProperties() because the latter function should not change the file before save() is called. Instead, the following policy is now consistently applied for file formats with multiple tag types: - the recommended tag type is created, if it does not exist - deprecated tags are updated, if they exist, but not created - illegal tag types are ignored by setProperties(), but used in properties() if no others exist. The only tag types considered "illegal" so far are APEv2 in MPEG and ID3 in FLAC.
This commit is contained in:
@ -168,10 +168,6 @@ void FLAC::File::removeUnsupportedProperties(const StringList &unsupported)
|
||||
|
||||
PropertyMap FLAC::File::setProperties(const PropertyMap &properties)
|
||||
{
|
||||
if(d->hasID3v1)
|
||||
d->tag.access<ID3v1::Tag>(FlacID3v1Index, false)->setProperties(properties);
|
||||
if(d->hasID3v2)
|
||||
d->tag.access<ID3v2::Tag>(FlacID3v2Index, false)->setProperties(properties);
|
||||
return d->tag.access<Ogg::XiphComment>(FlacXiphIndex, true)->setProperties(properties);
|
||||
}
|
||||
|
||||
|
||||
@ -135,7 +135,8 @@ namespace TagLib {
|
||||
* Implements the unified property interface -- import function.
|
||||
* This always creates a Xiph comment, if none exists. The return value
|
||||
* relates to the Xiph comment only.
|
||||
* Potential ID3v1 and ID3v2 tags will also be updated.
|
||||
* Ignores any changes to ID3v1 or ID3v2 comments since they are not allowed
|
||||
* in the FLAC specification.
|
||||
*/
|
||||
PropertyMap setProperties(const PropertyMap &);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user