mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-16 21:58:21 +01:00
Add 'itunes:duration' tag for items with duration (#3774)
* [{Atom,Mrss}Format] Allow itunes tags on items without enclosure * [Arte7Bridge] Add $item['itunes']['duration'] value
This commit is contained in:
parent
9056106c2d
commit
658391263e
@ -156,6 +156,10 @@ class Arte7Bridge extends BridgeAbstract
|
||||
. $element['mainImage']['url']
|
||||
. '" /></a>';
|
||||
|
||||
$item['itunes'] = [
|
||||
'duration' => $durationSeconds,
|
||||
];
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
@ -147,11 +147,13 @@ class AtomFormat extends FormatAbstract
|
||||
$entry->appendChild($itunesProperty);
|
||||
$itunesProperty->appendChild($document->createTextNode($itunesValue));
|
||||
}
|
||||
if (isset($itemArray['enclosure'])) {
|
||||
$itunesEnclosure = $document->createElement('enclosure');
|
||||
$entry->appendChild($itunesEnclosure);
|
||||
$itunesEnclosure->setAttribute('url', $itemArray['enclosure']['url']);
|
||||
$itunesEnclosure->setAttribute('length', $itemArray['enclosure']['length']);
|
||||
$itunesEnclosure->setAttribute('type', $itemArray['enclosure']['type']);
|
||||
}
|
||||
} elseif (!empty($entryUri)) {
|
||||
$entryLinkAlternate = $document->createElement('link');
|
||||
$entry->appendChild($entryLinkAlternate);
|
||||
|
@ -135,11 +135,13 @@ class MrssFormat extends FormatAbstract
|
||||
$entry->appendChild($itunesProperty);
|
||||
$itunesProperty->appendChild($document->createTextNode($itunesValue));
|
||||
}
|
||||
if (isset($itemArray['enclosure'])) {
|
||||
$itunesEnclosure = $document->createElement('enclosure');
|
||||
$entry->appendChild($itunesEnclosure);
|
||||
$itunesEnclosure->setAttribute('url', $itemArray['enclosure']['url']);
|
||||
$itunesEnclosure->setAttribute('length', $itemArray['enclosure']['length']);
|
||||
$itunesEnclosure->setAttribute('type', $itemArray['enclosure']['type']);
|
||||
}
|
||||
} if (!empty($itemUri)) {
|
||||
$entryLink = $document->createElement('link');
|
||||
$entry->appendChild($entryLink);
|
||||
|
Loading…
x
Reference in New Issue
Block a user