mediafront_audio.module in MediaFront 6
File
plugins/mediafront_audio/mediafront_audio.module
View source
<?php
function mediafront_audio_playlist_node($node, $args) {
$additions = array();
if ($node->audio_tags) {
if ($node->audio_tags["album"] && !$node->field_album) {
$additions["field_album"][0]["value"] = $node->audio_tags["album"];
}
if ($node->audio_tags["artist"] && !$node->field_artist) {
$additions["field_artist"][0]["value"] = $node->audio_tags["artist"];
}
if ($node->audio_tags["title"] && !$node->field_song) {
$additions["field_song"][0]["value"] = $node->audio_tags["title"];
}
}
if ($node->audio_images) {
mediafront_add_media($additions, array_shift($node->audio_images));
}
if ($node->audio) {
mediafront_add_media($additions, $node->audio['file']);
}
return $additions;
}