Merge pull request #91 from mmn/generate_thumbnail_if_it_doesnt_exist

Generate thumbnail if it doesn't exist
This commit is contained in:
Hannes Mannerheim 2015-01-26 00:59:56 +01:00
commit 82b60317c5

View File

@ -484,11 +484,9 @@ class QvitterPlugin extends Plugin {
foreach ($attachments as $attachment) {
try {
$enclosure_o = $attachment->getEnclosure();
$thumb = File_thumbnail::getKV('file_id', $attachment->id);
if(isset($thumb->url)) {
$attachment_url_to_id[$enclosure_o->url]['id'] = $attachment->id;
$attachment_url_to_id[$enclosure_o->url]['thumb_url'] = $thumb->url;
}
$thumb = $attachment->getThumbnail();
$attachment_url_to_id[$enclosure_o->url]['id'] = $attachment->id;
$attachment_url_to_id[$enclosure_o->url]['thumb_url'] = $thumb->getUrl();
} catch (ServerException $e) {
// There was not enough metadata available
}