Fix parsing promo_video_convo cards
This commit is contained in:
parent
27c8c0a97a
commit
f19443ed96
|
@ -255,6 +255,8 @@ proc parseCard*(card: var Card; node: XmlNode) =
|
||||||
|
|
||||||
if card.url.len == 0:
|
if card.url.len == 0:
|
||||||
card.url = node.selectAttr("a", "href")
|
card.url = node.selectAttr("a", "href")
|
||||||
|
if card.url.len == 0:
|
||||||
|
card.url = node.selectAttr(".ConvoCard-thankYouContent", "data-thank-you-url")
|
||||||
|
|
||||||
let image = node.select(".tcu-imageWrapper img")
|
let image = node.select(".tcu-imageWrapper img")
|
||||||
if image != nil:
|
if image != nil:
|
||||||
|
|
|
@ -99,6 +99,7 @@ type
|
||||||
summaryLarge = "summary_large_image"
|
summaryLarge = "summary_large_image"
|
||||||
promoWebsite = "promo_website"
|
promoWebsite = "promo_website"
|
||||||
promoVideo = "promo_video_website"
|
promoVideo = "promo_video_website"
|
||||||
|
promoVideoConvo = "promo_video_convo"
|
||||||
player = "player"
|
player = "player"
|
||||||
liveEvent = "live_event"
|
liveEvent = "live_event"
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,8 @@ proc renderCardContent(card: Card): VNode =
|
||||||
span(class="card-destination"): text card.dest
|
span(class="card-destination"): text card.dest
|
||||||
|
|
||||||
proc renderCard(card: Card; prefs: Prefs; path: string): VNode =
|
proc renderCard(card: Card; prefs: Prefs; path: string): VNode =
|
||||||
const largeCards = {summaryLarge, liveEvent, promoWebsite, promoVideo}
|
const largeCards = {summaryLarge, liveEvent, promoWebsite,
|
||||||
|
promoVideo, promoVideoConvo}
|
||||||
let large = if card.kind in largeCards: " large" else: ""
|
let large = if card.kind in largeCards: " large" else: ""
|
||||||
let url = replaceUrl(card.url, prefs)
|
let url = replaceUrl(card.url, prefs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue