`atom:link` should have `rel="self"`
harshcut opened this issue · comments
Description
When retrieving the atom:link
from an RSS feed, the current implementation fails to accurately identify the correct link for the feed URL. The expected behavior is to obtain the atom:link
element with the attribute rel="self"
, representing the feed's own URL. However, the current implementation is not consistently achieving this.
podcast-xml-parser/src/create.ts
Line 27 in 15081c2
Current Behavior
I have this feed URL, which has multiple atom:link
elements, out of which the first element is of rel="hub"
which should not be considered as a feed URL. The same hub is present for multiple feeds and causes an error for unique keys in database.
<!-- https://aufgeldreise.podigee.io/feed/mp3 -->
<atom:link href="https://pubsubhubbub.appspot.com/" rel="hub"/>
<atom:link href="https://aufgeldreise.podigee.io/feed/mp3" rel="self"/>
<atom:link href="https://aufgeldreise.podigee.io/feed/mp3" rel="first"/>
<atom:link href="https://aufgeldreise.podigee.io/feed/mp3?page=1" rel="last"/>
Expected Behavior
It should only identify and retrieve the atom:link
element with the attribute rel="self"
to obtain the feed's URL. If any links with such attribute is not found, then it should mark it as undefined
.
Closing, see more here: #9 (comment)