comparison scald_dailymotion.module @ 3:2a63a6e15166

Thumbnails: Don't try to file_set_status, they're not in the {files} table
author Franck Deroche <franck@defr.org>
date Mon, 19 Jul 2010 14:45:25 +0200
parents c57b2ac8f84c
children fd5fb845d0bc
comparison
equal deleted inserted replaced
2:c57b2ac8f84c 3:2a63a6e15166
74 $thumb = drupal_http_request($infos->thumbnail['src']); 74 $thumb = drupal_http_request($infos->thumbnail['src']);
75 $dir = file_directory_path() . '/dailymotion'; 75 $dir = file_directory_path() . '/dailymotion';
76 if ($thumb->code == 200 && file_check_directory($dir)) { 76 if ($thumb->code == 200 && file_check_directory($dir)) {
77 $dest = $dir . '/' . $infos->id . '.jpg'; 77 $dest = $dir . '/' . $infos->id . '.jpg';
78 $file = file_save_data($thumb->data, $dest); 78 $file = file_save_data($thumb->data, $dest);
79 if ($file) {
80 file_set_status($file, FILE_STATUS_PERMANENT);
81 }
82 } 79 }
83 // Create an atom 80 // Create an atom
84 $atom = new stdClass; 81 $atom = new stdClass;
85 $atom->type = 'video'; 82 $atom->type = 'video';
86 $atom->provider = 'scald_dailymotion'; 83 $atom->provider = 'scald_dailymotion';