From fd13be0f7a25b74bf901abb6209c00559b61318f Mon Sep 17 00:00:00 2001 From: Jimmy Huynh Date: Sat, 13 Mar 2021 01:32:10 +0100 Subject: =?UTF-8?q?=E2=9C=A8=20Update=20FeedFetcher:=20import=20'tags'=20t?= =?UTF-8?q?o=20'item'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jimmy Huynh --- lib/Fetcher/FeedFetcher.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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(); -- cgit v1.2.3