From 51adabf28fb5b791e3d144194a78e32445c37bdf Mon Sep 17 00:00:00 2001 From: Markus Ahlstrand Date: Mon, 20 May 2024 12:03:37 +0200 Subject: [PATCH] fix: selling point updates --- package.json | 2 +- src/feed-parser.ts | 2 ++ src/serialize-feed.ts | 2 +- src/sesamy-parser.ts | 3 ++- yarn.lock | 8 ++++---- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 71a56e6..3681da9 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "vitest": "1.6.0" }, "dependencies": { - "@sesamy/podcast-schemas": "^1.4.2", + "@sesamy/podcast-schemas": "^1.4.3", "fast-xml-parser": "^4.4.0", "sanitize-html": "^2.13.0", "zod": "^3.23.8" diff --git a/src/feed-parser.ts b/src/feed-parser.ts index a360081..48cb621 100644 --- a/src/feed-parser.ts +++ b/src/feed-parser.ts @@ -9,6 +9,8 @@ export default async function parseFeedToJson(text: string): Promise { 'itunes:category', 'sesamy:sesamy-item', 'sesamy:product', + 'sesamy:selling-point', + 'sesamy:price-override', 'enclosure', ]; diff --git a/src/serialize-feed.ts b/src/serialize-feed.ts index 99459fa..17f1e34 100644 --- a/src/serialize-feed.ts +++ b/src/serialize-feed.ts @@ -135,7 +135,7 @@ export function generateRssFeed(feed: SesamyFeed): string { 'sesamy:period': product.period, time: product.time, 'sesamy:time': product.time, - 'sesamy:selling-points': product.sellingPoints || [], + 'sesamy:selling-point': product.sellingPoints || [], })), 'sesamy:sesamy-item': lockedEpisodes, item: episodes, diff --git a/src/sesamy-parser.ts b/src/sesamy-parser.ts index e597722..2e34022 100644 --- a/src/sesamy-parser.ts +++ b/src/sesamy-parser.ts @@ -141,7 +141,8 @@ export function parseFeedToSesamy(feed: RssFeed) { title: item['sesamy:title'] || item.title, description: item['sesamy:description'] || item.description, type: item.type, - priceOverrides: item['sesamy:price-overrides'] ?? [], + priceOverrides: item['sesamy:price-override'] ?? [], + sellingPoints: item['sesamy:price-override'] ?? [], price: item['sesamy:price'] || item.price, currency: item['sesamy:currency'] || item.currency, period: item['sesamy:period'] || item.period, diff --git a/yarn.lock b/yarn.lock index 15769e7..a3b79a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -744,10 +744,10 @@ lodash-es "^4.17.21" read-pkg-up "^11.0.0" -"@sesamy/podcast-schemas@^1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@sesamy/podcast-schemas/-/podcast-schemas-1.4.2.tgz#cab19af7df44a5a9d5f61dbced19dcd428fd7cd9" - integrity sha512-rMXjqbNXDSpyqTjtk9AiuFWDNl6hDlnjZzryzsdFIcK7hx8yQnpEQ6wjAlLFWt2HKAaq7U8xVw2b0g5O8+9/QA== +"@sesamy/podcast-schemas@^1.4.3": + version "1.4.3" + resolved "https://registry.yarnpkg.com/@sesamy/podcast-schemas/-/podcast-schemas-1.4.3.tgz#06749db85ba80eebe68fa95ba5634d9d099c5ae2" + integrity sha512-LU4fpCmuTXHT4OKatvxu/ZI/pebhFrtO/PlG/N0g+LSWj1WS4HUJltgWCpdkugF9O5GOhmOHQsf5nr2svdbPMA== dependencies: zod "^3.23.8"