1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-31 02:31:33 +00:00

* move get_article_image to Article; implement better og:image detection (similar to android app)

* pass article image to API clients in headlines row object
This commit is contained in:
Andrew Dolgov
2019-08-14 16:55:38 +03:00
parent 26dbe02968
commit 68e2b05f65
3 changed files with 47 additions and 33 deletions

View File

@@ -759,9 +759,10 @@ class API extends Handler {
"tags" => $tags,
);
$enclosures = Article::get_article_enclosures($line['id']);
if ($include_attachments)
$headline_row['attachments'] = Article::get_article_enclosures(
$line['id']);
$headline_row['attachments'] = $enclosures;
if ($show_excerpt)
$headline_row["excerpt"] = $line["content_preview"];
@@ -801,7 +802,8 @@ class API extends Handler {
$headline_row = $p->hook_render_article_api(array("headline" => $headline_row));
}
$headline_row['content'] = DiskCache::rewriteUrls($headline_row['content']);
$headline_row["content"] = DiskCache::rewriteUrls($headline_row['content']);
$headline_row["flavor_image"] = Article::get_article_image($enclosures, $line["content"], $line["site_url"]);
array_push($headlines, $headline_row);
}