Skip to content

Commit

Permalink
Add audioUrl to TalkingKotlin.
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Dec 24, 2023
1 parent e136b96 commit 1643ca3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ data class TalkingKotlinItem(
@XmlElement(true)
@XmlSerialName(value = "summary", namespace = Namespace.itunes, prefix = "")
val summary: String,
val enclosure: Enclosure,
val image: Image,
) {
@XmlSerialName("enclosure", "", "")
@Serializable
data class Enclosure(
@XmlElement(false)
val url: String,
)

@XmlSerialName("image", Namespace.itunes, "")
@Serializable
data class Image(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fun TalkingKotlinItem.toTalkingKotlinEntry(): TalkingKotlin {
.toInstant(),
contentUrl = link,
thumbnailUrl = image.href,
audioUrl = enclosure.url,
summary = summary,
duration = duration.toFormattedDuration(),
)
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/schema/kstreamlined.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ type TalkingKotlin implements FeedEntry {
publishTime: Instant!
"Url of the content."
contentUrl: String!
"Url of the podcast audio file."
audioUrl: String!
"Url of the podcast thumbnail."
thumbnailUrl: String!
"Summary of the podcast."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ val DummyTalkingKotlinItem = TalkingKotlinItem(
pubDate = "Tue, 28 Jun 2022 16:00:27 +0000",
summary = "We chat with Raul, Simon, and Alejandro to learn how Arrow adds functional paradigms and safety to Kotlin, and how it aims to influence the future of the language.",
duration = "00:57:44",
enclosure = TalkingKotlinItem.Enclosure(url = "https://feeds.soundcloud.com/stream/1295949565-user-38099918-arrow-analysis.mp3"),
image = TalkingKotlinItem.Image(href = "https://i1.sndcdn.com/artworks-yEP8SdbEZOJcmVay-AWlLHQ-t3000x3000.jpg"),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class RealFeedClientTest {
pubDate = "Tue, 28 Jun 2022 16:00:27 +0000",
summary = "We chat with Raul, Simon, and Alejandro to learn how Arrow adds functional paradigms and safety to Kotlin, and how it aims to influence the future of the language.",
duration = "00:57:44",
enclosure = TalkingKotlinItem.Enclosure(url = "https://feeds.soundcloud.com/stream/1295949565-user-38099918-arrow-analysis.mp3"),
image = TalkingKotlinItem.Image(href = "https://i1.sndcdn.com/artworks-yEP8SdbEZOJcmVay-AWlLHQ-t3000x3000.jpg"),
),
TalkingKotlinItem(
Expand All @@ -222,6 +223,7 @@ class RealFeedClientTest {
pubDate = "Tue, 19 Apr 2022 16:00:24 +0000",
summary = "We talked to Rares Vlasceanu and Catalin Costache from Adobe about how they handle 70 000 000 000 events per day with the help of Kotlin and Ktor.",
duration = "00:51:09",
enclosure = TalkingKotlinItem.Enclosure(url = "https://feeds.soundcloud.com/stream/1253069788-user-38099918-70-billion-events-per-day-adobe-kotlin.mp3"),
image = TalkingKotlinItem.Image(href = "https://i1.sndcdn.com/artworks-ANd7JtyjHYkhAUsQ-XU8I0Q-t3000x3000.jpg"),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class FeedEntryDataFetcherTest {
description
}
... on TalkingKotlin {
audioUrl
thumbnailUrl
summary
duration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class TalkingKotlinEntryMapperTest {
title = "Podcast title",
publishTime = Instant.parse("2022-11-22T16:30:09Z"),
contentUrl = "url",
audioUrl = "audio-url",
thumbnailUrl = "image-url",
summary = "summary",
duration = "43min.",
Expand All @@ -26,6 +27,7 @@ class TalkingKotlinEntryMapperTest {
link = "url",
duration = "00:43:14",
summary = "summary",
enclosure = TalkingKotlinItem.Enclosure(url = "audio-url"),
image = TalkingKotlinItem.Image(href = "image-url"),
).toTalkingKotlinEntry()

Expand Down

0 comments on commit 1643ca3

Please sign in to comment.