Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyford committed Nov 25, 2024
1 parent 57b34a6 commit c7920d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion usage/app/lib/ContentApis.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract class UsageContentApiClient(config: UsageConfig)(implicit val executor:
def usageQuery(contentId: String): ItemQuery = {
ItemQuery(contentId)
.showFields("firstPublicationDate,isLive,internalComposerCode")
.showElements("image")
.showElements("image,cartoon")
.showAtoms("media")
}
}
Expand Down
11 changes: 10 additions & 1 deletion usage/app/model/UsageGroup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,13 @@ class UsageGroupOps(config: UsageConfig, mediaWrapperOps: MediaWrapperOps)
val usage = MediaUsageBuilder.build(mediaWrapper)
createUsagesLogging(usage)(logMarker)
}
val cartoonElementUsages = extractCartoonUsages(content, usageStatus, isReindex)(extractJobLogMarkers).map { element =>
// TODO
}

// TODO capture images from interactive embeds

mediaAtomsUsages ++ imageElementUsages
mediaAtomsUsages ++ imageElementUsages ++ cartoonElementUsages
}

private def createUsagesLogging(usage: MediaUsage)(implicit logMarker: LogMarker) = {
Expand Down Expand Up @@ -202,6 +205,12 @@ class UsageGroupOps(config: UsageConfig, mediaWrapperOps: MediaWrapperOps)
}
}

private def extractCartoonUsages(content: Content, status: UsageStatus, bool: Boolean) = {
content.elements.map(_.filter(_.`type` == ElementType.Cartoon).map { element =>
element.
})
}

private def extractImageElements(
content: Content, usageStatus: UsageStatus, isReindex: Boolean
)(implicit logMarker: LogMarker): Seq[Element] = {
Expand Down

0 comments on commit c7920d6

Please sign in to comment.