1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2026-01-23 11:07:11 +00:00

wip for flavor images

This commit is contained in:
Andrew Dolgov
2021-03-08 18:26:13 +03:00
parent cfb4882591
commit 76f5443080
9 changed files with 84 additions and 15 deletions

View File

@@ -244,6 +244,38 @@ class Feeds extends Handler_Protected {
},
$line);
$this->_mark_timestamp(" pre-enclosures");
if ($line["num_enclosures"] > 0) {
$enclosures = Article::_get_enclosures($id);
$line["enclosures"] = Article::_format_enclosures($id,
$line["always_display_enclosures"],
$line["content"],
$line["hide_images"],
$enclosures);
} else {
$enclosures = [];
$line["enclosures"] = [ 'formatted' => '', 'entries' => [] ];
}
$this->_mark_timestamp(" enclosures");
list ($flavor_image, $flavor_stream, $flavor_kind) = Article::_get_image($enclosures,
$line["content"], // unsanitized
$line["site_url"],
$line);
$line["flavor_image"] = $flavor_image;
$line["flavor_stream"] = $flavor_stream;
/* optional */
if ($flavor_kind)
$line["flavor_kind"] = $flavor_kind;
$this->_mark_timestamp(" flavor image");
$this->_mark_timestamp(" pre-sanitize");
$line["content"] = Sanitizer::sanitize($line["content"],
@@ -261,19 +293,6 @@ class Feeds extends Handler_Protected {
}
}
$this->_mark_timestamp(" pre-enclosures");
if ($line["num_enclosures"] > 0) {
$line["enclosures"] = Article::_format_enclosures($id,
$line["always_display_enclosures"],
$line["content"],
$line["hide_images"]);
} else {
$line["enclosures"] = [ 'formatted' => '', 'entries' => [] ];
}
$this->_mark_timestamp(" enclosures");
$line["updated_long"] = TimeHelper::make_local_datetime($line["updated"],true);
$line["updated"] = TimeHelper::make_local_datetime($line["updated"], false, false, false, true);
@@ -315,6 +334,7 @@ class Feeds extends Handler_Protected {
}
$this->_mark_timestamp(" color");
$this->_mark_timestamp(" pre-hook_render_cdm");
PluginHost::getInstance()->chain_hooks_callback(PluginHost::HOOK_RENDER_ARTICLE_CDM,