in common/src/main/scala/com/gu/media/util/MediaAtomImplicits.scala [46:60]
private def getActiveAsset(atom: MediaAtom): Option[VideoAsset] = {
atom.activeVersion.map { version =>
atom.assets.filter(_.version == version) match {
case asset :: Nil if asset.platform == Youtube =>
YouTubeAsset(asset.id)
case assets =>
val sources = assets.collect {
case Asset(_, _, id, _, Some(mimeType)) => VideoSource(id, mimeType)
}
SelfHostedAsset(sources.toList)
}
}
}