You are here

function mediafront_audio_playlist_node in MediaFront 6.2

Same name and namespace in other branches
  1. 6 plugins/mediafront_audio/mediafront_audio.module \mediafront_audio_playlist_node()

Implementation of hook_playlist_node

File

plugins/mediafront_audio/mediafront_audio.module, line 5

Code

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;
}