mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-26 03:31:30 +00:00
* add HOOK_ENCLOSURE_IMPORTED
* pass feed id to HOOK_FEED_PARSED
This commit is contained in:
@@ -65,6 +65,7 @@ class PluginHost {
|
|||||||
const HOOK_ARTICLE_IMAGE = 42;
|
const HOOK_ARTICLE_IMAGE = 42;
|
||||||
const HOOK_FEED_TREE = 43;
|
const HOOK_FEED_TREE = 43;
|
||||||
const HOOK_IFRAME_WHITELISTED = 44;
|
const HOOK_IFRAME_WHITELISTED = 44;
|
||||||
|
const HOOK_ENCLOSURE_IMPORTED = 45;
|
||||||
|
|
||||||
const KIND_ALL = 1;
|
const KIND_ALL = 1;
|
||||||
const KIND_SYSTEM = 2;
|
const KIND_SYSTEM = 2;
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ class RSSUtils {
|
|||||||
foreach ($pluginhost->get_hooks(PluginHost::HOOK_FEED_PARSED) as $plugin) {
|
foreach ($pluginhost->get_hooks(PluginHost::HOOK_FEED_PARSED) as $plugin) {
|
||||||
Debug::log("... " . get_class($plugin), Debug::$LOG_VERBOSE);
|
Debug::log("... " . get_class($plugin), Debug::$LOG_VERBOSE);
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
$plugin->hook_feed_parsed($rss);
|
$plugin->hook_feed_parsed($rss, $feed);
|
||||||
Debug::log(sprintf("=== %.4f (sec)", microtime(true) - $start), Debug::$LOG_VERBOSE);
|
Debug::log(sprintf("=== %.4f (sec)", microtime(true) - $start), Debug::$LOG_VERBOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1032,6 +1032,13 @@ class RSSUtils {
|
|||||||
|
|
||||||
if (is_array($encs)) {
|
if (is_array($encs)) {
|
||||||
foreach ($encs as $e) {
|
foreach ($encs as $e) {
|
||||||
|
|
||||||
|
foreach ($pluginhost->get_hooks(PluginHost::HOOK_ENCLOSURE_IMPORTED) as $plugin) {
|
||||||
|
$e = $plugin->hook_enclosure_imported($e, $feed);
|
||||||
|
}
|
||||||
|
|
||||||
|
var_dump($e);
|
||||||
|
|
||||||
$e_item = array(
|
$e_item = array(
|
||||||
rewrite_relative_url($site_url, $e->link),
|
rewrite_relative_url($site_url, $e->link),
|
||||||
$e->type, $e->length, $e->title, $e->width, $e->height);
|
$e->type, $e->length, $e->title, $e->width, $e->height);
|
||||||
|
|||||||
Reference in New Issue
Block a user