function scald_audio_scald_fetch in Scald: Media Management made easy 7
Implements hook_scald_fetch().
File
- modules/
providers/ scald_audio/ scald_audio.module, line 141 - Scald Audio is a Scald Atom Provider for audio files.
Code
function scald_audio_scald_fetch($atom, $type) {
$file_items = field_get_items('scald_atom', $atom, 'scald_thumbnail');
if (!empty($file_items)) {
$file_item = current($file_items);
if (file_exists($file_item['uri'])) {
$atom->thumbnail_source = $file_item['uri'];
}
}
$file = file_load($atom->base_id);
$atom->base_entity = $file;
$atom->file_source = $atom->data['audio_file'];
}