Integrate fetching of the content type into "getSiteinfo"

This commit is contained in:
Michael 2021-03-13 07:03:26 +00:00
parent 262ee2b0b1
commit ffb92e3355
3 changed files with 13 additions and 11 deletions

View file

@ -94,10 +94,10 @@ class ParseUrl extends BaseModule
}
if ($format == 'json') {
$type = Util\ParseUrl::getContentType($url);
$siteinfo = Util\ParseUrl::getSiteinfoCached($url);
if (in_array($type, ['image', 'video', 'audio'])) {
switch ($type) {
if (in_array($siteinfo['type'], ['image', 'video', 'audio'])) {
switch ($siteinfo['type']) {
case 'video':
$content_type = 'video';
break;
@ -113,8 +113,6 @@ class ParseUrl extends BaseModule
$ret['data'] = ['url' => $url];
$ret['success'] = true;
} else {
$siteinfo = Util\ParseUrl::getSiteinfoCached($url);
unset($siteinfo['keywords']);
$ret['data'] = $siteinfo;