You are here

mediafront_audio.module in MediaFront 6.2

Same filename and directory in other branches
  1. 6 plugins/mediafront_audio/mediafront_audio.module

File

plugins/mediafront_audio/mediafront_audio.module
View source
<?php

/**
 * Implementation of hook_playlist_node
 */
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;
}

Functions

Namesort descending Description
mediafront_audio_playlist_node Implementation of hook_playlist_node