feat(autotag) prefix titles with [video] if it's youtube link
This commit is contained in:
parent
fce544cc1f
commit
7ff7d9f7c5
@ -231,6 +231,15 @@ function apply_auto_tags(array $data, ConfigManager $conf): array
|
||||
return $data;
|
||||
}
|
||||
|
||||
if (stripos($data['link']['url'], 'youtube.com') !== false || stripos($data['link']['url'], 'youtu.be') !== false) {
|
||||
$title = $data['link']['title'] ?? '';
|
||||
|
||||
// Ajoute le tag [Video] au début du titre s'il n'est pas déjà présent
|
||||
if (stripos($title, '[Video]') !== 0) {
|
||||
$data['link']['title'] = '[Video] ' . $title;
|
||||
}
|
||||
}
|
||||
|
||||
$keywordsToTags = $conf->get('plugins.AUTO_TAG_KEYWORDS', []);
|
||||
$pageContent = fetch_page_content($data['link']['url']);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user