summaryrefslogtreecommitdiffstats
path: root/lib/Fetcher
diff options
context:
space:
mode:
authorÉloi Rivard <eloi.rivard@aquilenet.fr>2020-02-16 14:26:06 +0100
committerGitHub <noreply@github.com>2020-02-16 14:26:06 +0100
commit306d3cdc608343b5739b98a7d6b1e816416489c9 (patch)
treef62b93191d0677709556c7c547d4af4e9eef19d2 /lib/Fetcher
parentcdd15c181875dbbc62844718365c47b099027b3a (diff)
Basic Media-RSS support (#599)
Signed-off-by: Éloi Rivard <azmeuk@gmail.com>
Diffstat (limited to 'lib/Fetcher')
-rwxr-xr-xlib/Fetcher/FeedFetcher.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php
index a1b7e08ec..82ad86352 100755
--- a/lib/Fetcher/FeedFetcher.php
+++ b/lib/Fetcher/FeedFetcher.php
@@ -256,11 +256,19 @@ class FeedFetcher implements IFeedFetcher
if ($parsedItem->hasMedia()) {
// TODO: Fix multiple media support
foreach ($parsedItem->getMedias() as $media) {
- if (!$item->isSupportedMime($media->getType())) {
+ if (!$item->isSupportedMime($media->getType())
+ && !$media->getThumbnail()
+ && !$media->getDescription()
+ ) {
continue;
}
$item->setEnclosureMime($media->getType());
$item->setEnclosureLink($media->getUrl());
+ $item->setMediaThumbnail($media->getThumbnail());
+ if ($media->getDescription()) {
+ $description = str_replace("\n", "<br>", $media->getDescription());
+ $item->setMediaDescription($description);
+ }
}
}