def asThrift()

in common/src/main/scala/com/gu/media/model/MediaAtom.scala [81:127]


  def asThrift(id: String, contentChangeDetails: ContentChangeDetails) = {
    val data = ThriftMediaAtom(
      assets = Nil,
      activeVersion = None,
      title = title,
      category = category.asThrift,
      duration = None,
      source = source,
      posterUrl = posterImage.flatMap(_.master).map(_.file),
      description = description,
      trailText = trailText,
      posterImage = posterImage.map(_.asThrift),
      trailImage = trailImage.map(_.asThrift),
      youtubeOverrideImage = youtubeOverrideImage.map(_.asThrift),
      byline = Some(byline),
      commissioningDesks = Some(commissioningDesks),
      keywords = Some(keywords),
      metadata = Some(ThriftMetadata(
        tags = Some(tags),
        categoryId = youtubeCategoryId,
        license = license,
        channelId = channelId,
        privacyStatus = privacyStatus.flatMap(_.asThrift),
        expiryDate = expiryDate,
        pluto = None,
        youtube = Some(ThriftYoutubeData(youtubeTitle, youtubeDescription))
      )),
      commentsEnabled = composerCommentsEnabled,
      optimisedForWeb = optimisedForWeb,
      suppressRelatedContent = suppressRelatedContent
    )

    ThriftAtom(
      id = id,
      atomType = ThriftAtomType.Media,
      labels = List(),
      defaultHtml = MediaAtomImplicits.defaultMediaHtml(data),
      title = Some(title),
      data = AtomData.Media(data),
      contentChangeDetails = contentChangeDetails.asThrift,
      flags = Some(ThriftFlags(
        legallySensitive = legallySensitive,
        blockAds = Some(blockAds),
        sensitive = sensitive
      ))
    )
  }