I second that! GetID3 is a wonderful tool and has been extremely helpful in my projects. However, this overwrite issue seems to be a solid bug. I really hope someone can look into it soon, since I am not confident in my code without this fixed.
My current workaround is to copy tags to comments, import all tags into an array, change only the tags that I have specified, and then write it all back. This works, but again I'm not confident in it as a fix, since I think some info is being lost in translation. Here's a snippet of my workaround:
- Code: Select all
//Initialize
$getID3 = new getID3;
$TagData = $getID3->Analyze($phy_path);
getid3_lib::CopyTagsToComments($TagData);
//Options
$metawriter->filename = $phy_path;
$metawriter->tagformats = $tagformats;
$metawriter->remove_other_tags = false;
$metawriter->overwrite_tags = true;
//Empty 'comments' if this happened to be one of the incoming fields
unset($info['comments']);
unset($TagData['comments']['comments']);
//Write existing tags to comments array
foreach($TagData['comments'] AS $field => $value)
$TagData[$field] = $value;
//Write new incoming tags to same array as above, which overwrites only those requested
foreach($info as $field => $value)
$TagData[$field][0] = $value;
$metawriter->tag_data = $TagData;
// write tags
$metawriter->WriteTags();
//...