Commit 0b33c62a authored by Bart De Vries's avatar Bart De Vries
Browse files

Select first enclosure if entry has multiple enclosure entries

Kasts can currently only handle one enclosure per entry.  In case an
entry/item has multiple enclosures, it's probably safe to assume that the
first one is the one that's preferred by the author.

CCBUG: 440389
parent 6eb13167
Pipeline #72534 passed with stage
in 8 minutes and 40 seconds
......@@ -303,8 +303,11 @@ bool Fetcher::processEntry(Syndication::ItemPtr entry, const QString &url, bool
processAuthor(url, entry->id(), authorName, QLatin1String(""), QLatin1String(""));
}
for (const auto &enclosure : entry->enclosures()) {
processEnclosure(enclosure, entry, url);
// only process first enclosure if there are multiple (e.g. mp3 and ogg);
// the first one is probably the podcast author's preferred version
// TODO: handle more than one enclosure?
if (entry->enclosures().count() > 0) {
processEnclosure(entry->enclosures()[0], entry, url);
}
Q_EMIT entryAdded(url, entry->id());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment