Oembed bugs with thumbnail generation.
This commit is contained in:
parent
5ccf3ed714
commit
ce65fe96ad
@ -84,26 +84,25 @@ class OembedAction extends Action
|
|||||||
$oembed['html']=$notice->getRendered();
|
$oembed['html']=$notice->getRendered();
|
||||||
|
|
||||||
// maybe add thumbnail
|
// maybe add thumbnail
|
||||||
$attachments = $notice->attachments();
|
foreach ($notice->attachments() as $attachment) {
|
||||||
if (!empty($attachments)) {
|
if (!$attachment instanceof File) {
|
||||||
foreach ($attachments as $attachment) {
|
common_debug('ATTACHMENTS array entry from notice id=='._ve($notice->getID()).' is something else than a File dataobject: '._ve($attachment));
|
||||||
if(is_object($attachment)) {
|
continue;
|
||||||
try {
|
}
|
||||||
$thumb = $attachment->getThumbnail();
|
try {
|
||||||
} catch (ServerException $e) {
|
$thumb = $attachment->getThumbnail();
|
||||||
//
|
$thumb_url = File_thumbnail::url($thumb->filename);
|
||||||
}
|
$oembed['thumbnail_url'] = $thumb_url;
|
||||||
try {
|
break; // only first one
|
||||||
$thumb_url = File_thumbnail::url($thumb->filename);
|
} catch (UseFileAsThumbnailException $e) {
|
||||||
$oembed['thumbnail_url'] = $thumb_url;
|
$oembed['thumbnail_url'] = $attachment->getUrl();
|
||||||
break; // only first one
|
break; // we're happy with that
|
||||||
} catch (ClientException $e) {
|
} catch (ServerException $e) {
|
||||||
//
|
//
|
||||||
}
|
} catch (ClientException $e) {
|
||||||
}
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'attachment':
|
case 'attachment':
|
||||||
|
Loading…
Reference in New Issue
Block a user