Only update whats needed?

Post Reply
deived
User
Posts: 1
Joined: Tue Oct 12, 2010 9:03 pm
Are you a spambot?: no

Only update whats needed?

Post by deived » Tue Oct 12, 2010 9:10 pm

I'm using getID3 for an online podcast catcher that I made. The script downloads the file onto my server. I'm using geID3 to update the tags as they come in. All I want to update is genre, artist, and album, and keep everything else intact (title, year, track, picture, etc...). When the tags are updated, it seems to remove everything else. Any help?

Code: Select all

    $TaggingFormat = 'UTF-16';
    $getID3 = new getID3;
    $getID3->setOption(array('encoding'=>$TaggingFormat));
    require_once('getid3/write.php');
    $tagwriter = new getid3_writetags;
    $tagwriter->filename       = $file;
    $tagwriter->tagformats     = array('id3v1', 'id3v2.3');
    
// set various options (optional)
$tagwriter->overwrite_tags = true;
$tagwriter->tag_encoding   = $TaggingFormat;
$tagwriter->remove_other_tags = false;

// populate data array
$TagData['Artist'][]  = $showname;
$TagData['Album'][]   = $showname;
$TagData['Genre'][]   = 'Podcast';
$tagwriter->tag_data = $TagData;

// write tags

if ($tagwriter->WriteTags()) {
    echo 'Successfully wrote tags<br>';
    if (!empty($tagwriter->warnings)) {
        echo 'There were some warnings:<br>'.implode('<br><br>', $tagwriter->warnings);
    }
} else {
    echo 'Failed to write tags!<br>'.implode('<br><br>', $tagwriter->errors);
}

Post Reply