feedkeeper 0.47.2 → 0.47.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -428,8 +428,22 @@ function extractXmlArtworkUrl(parsed) {
|
|
|
428
428
|
return parsed.icon.trim();
|
|
429
429
|
return undefined;
|
|
430
430
|
}
|
|
431
|
+
function asMediaText(value) {
|
|
432
|
+
if (Array.isArray(value)) {
|
|
433
|
+
for (const entry of value) {
|
|
434
|
+
const found = asMediaText(entry);
|
|
435
|
+
if (found)
|
|
436
|
+
return found;
|
|
437
|
+
}
|
|
438
|
+
return undefined;
|
|
439
|
+
}
|
|
440
|
+
if (isRecord(value) && typeof value._ === "string") {
|
|
441
|
+
return asNonEmptyString(value._) ?? undefined;
|
|
442
|
+
}
|
|
443
|
+
return asNonEmptyString(value) ?? undefined;
|
|
444
|
+
}
|
|
431
445
|
function extractXmlMediaDescription(item) {
|
|
432
|
-
const direct =
|
|
446
|
+
const direct = asMediaText(item["media:description"]);
|
|
433
447
|
if (direct)
|
|
434
448
|
return direct;
|
|
435
449
|
const mediaGroup = item.mediaGroup ?? item["media:group"];
|
|
@@ -437,7 +451,7 @@ function extractXmlMediaDescription(item) {
|
|
|
437
451
|
for (const group of asMediaEntries(mediaGroup)) {
|
|
438
452
|
if (!isRecord(group))
|
|
439
453
|
continue;
|
|
440
|
-
const grouped =
|
|
454
|
+
const grouped = asMediaText(group["media:description"] ?? group.mediaDescription);
|
|
441
455
|
if (grouped)
|
|
442
456
|
return grouped;
|
|
443
457
|
}
|
|
@@ -220,7 +220,8 @@ export function upsertItems(feedId, items) {
|
|
|
220
220
|
// a feed that alternates between two variants would change the content on every poll.
|
|
221
221
|
const keptPrevious = retained !== null && next !== retained;
|
|
222
222
|
const nextSnippet = keptPrevious ? null : row.contentSnippet ?? null;
|
|
223
|
-
const
|
|
223
|
+
const previousImageIsLegacyYouTubeSwf = Boolean(previous?.image_url && /^https?:\/\/(?:www\.)?youtube\.com\/v\//i.test(previous.image_url));
|
|
224
|
+
const reusablePreviousImage = previous?.image_url && !isAvatarImageUrl(previous.image_url) && !previousImageIsLegacyYouTubeSwf ? previous.image_url : null;
|
|
224
225
|
const nextImage = largerHeroImage(row.imageUrl, retained, row.link ?? previous?.link ?? null) ?? reusablePreviousImage ?? row.imageUrl ?? null;
|
|
225
226
|
if (previous) {
|
|
226
227
|
const changed = (row.title !== undefined && row.title !== previous.title) ||
|