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:
Michael Helmling
2012-12-26 22:46:37 +01:00
parent a095c468b2
commit f1d723077f
10 changed files with 9 additions and 17 deletions

View File

@ -136,7 +136,7 @@ void MPC::File::removeUnsupportedProperties(const StringList &properties)
PropertyMap MPC::File::setProperties(const PropertyMap &properties)
{
if(d->hasID3v1)
strip(ID3v1);
d->tag.access<APE::Tag>(MPCID3v1Index, false)->setProperties(properties);
return d->tag.access<APE::Tag>(MPCAPEIndex, true)->setProperties(properties);
}

View File

@ -125,7 +125,7 @@ namespace TagLib {
/*!
* Implements the unified property interface -- import function.
* Affects only the APEv2 tag which will be created if necessary.
* If an ID3v1 tag exists, it will be stripped from the file.
* If an ID3v1 tag exists, it will be updated as well.
*/
PropertyMap setProperties(const PropertyMap &);