Mercurial > defr > drupal > scald > scald_dailymotion
comparison scald_dailymotion.module @ 8:da69ba21d0c3
Check that the thumbnail is here before using it
author | Franck Deroche <franck@defr.org> |
---|---|
date | Mon, 26 Jul 2010 14:48:55 +0200 |
parents | f3040f91b65d |
children | 1907129beb95 |
comparison
equal
deleted
inserted
replaced
7:f3040f91b65d | 8:da69ba21d0c3 |
---|---|
22 | 22 |
23 /** | 23 /** |
24 * Implements hook_scald_fetch. | 24 * Implements hook_scald_fetch. |
25 */ | 25 */ |
26 function scald_dailymotion_scald_fetch(&$atom) { | 26 function scald_dailymotion_scald_fetch(&$atom) { |
27 $atom->thumbnail_source = file_directory_path() . '/dailymotion/'. $atom->base_id .'.jpg'; | 27 $file = file_directory_path() . '/dailymotion/'. $atom->base_id .'.jpg'; |
28 $atom->file_source = $atom->thumbnail_source; | 28 if (file_exists($file)) { |
29 $atom->thumbnail_source = $file; | |
30 $atom->file_source = $atom->thumbnail_source; | |
31 } | |
29 } | 32 } |
30 | 33 |
31 /** | 34 /** |
32 * Implements hook_scald_prerender. | 35 * Implements hook_scald_prerender. |
33 */ | 36 */ |