summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Huynh <jimmy.huynh@etu.unistra.fr>2021-03-13 01:32:10 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-03-17 08:58:42 +0100
commitfd13be0f7a25b74bf901abb6209c00559b61318f (patch)
treeab2602d8e68ef9b5875f60182f47a21fe569ba7a
parentf21738471675367e5dd09b78808f64830549673c (diff)
✨ Update FeedFetcher: import 'tags' to 'item'
Signed-off-by: Jimmy Huynh <jimmy.huynh@etu.unistra.fr>
-rwxr-xr-xlib/Fetcher/FeedFetcher.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php
index 3035b0e5e..ea1a188ce 100755
--- a/lib/Fetcher/FeedFetcher.php
+++ b/lib/Fetcher/FeedFetcher.php
@@ -256,6 +256,14 @@ class FeedFetcher implements IFeedFetcher
$item->setAuthor($this->decodeTwice($author->getName()));
}
+ $categories = [];
+ foreach ($parsedItem->getCategories() as $category) {
+ $categories[] = $this->decodeTwice($category->getLabel());
+ }
+ if (count($categories) > 0) {
+ $item->setTags(implode(',', $categories));
+ }
+
// Use description from feed if body is not provided (by a scraper)
if ($body === null) {
$body = $parsedItem->getValue("content:encoded") ?? $parsedItem->getDescription();