Skip to content

Commit

Permalink
Fix source in DCR data model (#27077)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakeii authored Apr 25, 2024
1 parent 33cfc17 commit afdcd77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/app/model/content.scala
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,10 @@ object Video {
val contentType = DotcomContentType.Video
val elements = content.elements
val section = content.metadata.sectionId
val source: Option[String] = elements.videos.find(_.properties.isMain).flatMap(_.videos.source)
val source = elements.videos
.find(_.properties.isMain)
.flatMap(_.videos.source)
.orElse(content.media.headOption.flatMap(_.source))

val javascriptConfig: Map[String, JsValue] = Map(
"isPodcast" -> JsBoolean(content.tags.isPodcast),
Expand Down

0 comments on commit afdcd77

Please sign in to comment.