Skip to content

Commit 565483a

Browse files
committed
Rename to Storylines Content
1 parent 223b10d commit 565483a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import play.api.mvc.{Filter, RequestHeader}
1313

1414
// this mirrors the structure in the tool generating the content
1515
// https://github.com/guardian/tag-page-supercharger/blob/main/app/models/FrontendContent.scala#L18
16-
case class TagPageAIContent(
16+
case class StorylinesContent(
1717
created: Instant,
1818
tag: String,
1919
storylines: List[Storyline],
@@ -136,25 +136,25 @@ object ArticleData {
136136

137137
}
138138

139-
object TagPageAIContent extends GuLogging {
140-
implicit val tpsgContentDecoder: Decoder[TagPageAIContent] = deriveDecoder
141-
implicit val tpsgContentEncoder: Encoder[TagPageAIContent] = deriveEncoder
142-
implicit val tpsgWrites: Writes[TagPageAIContent] = Json.writes[TagPageAIContent]
139+
object StorylinesContent extends GuLogging {
140+
implicit val tpsgContentDecoder: Decoder[StorylinesContent] = deriveDecoder
141+
implicit val tpsgContentEncoder: Encoder[StorylinesContent] = deriveEncoder
142+
implicit val tpsgWrites: Writes[StorylinesContent] = Json.writes[StorylinesContent]
143143

144-
def getContent(tag: String)(implicit rh: RequestHeader): Option[TagPageAIContent] = {
144+
def getContent(tag: String)(implicit rh: RequestHeader): Option[StorylinesContent] = {
145145
if (ActiveExperiments.isParticipating(AITagPageContent)) {
146146
lazy val stage: String = Configuration.facia.stage.toUpperCase
147147
val encodedTag = java.net.URLEncoder.encode(tag, "UTF-8")
148148
val location = s"$stage/tag-page-ai-data/$encodedTag.json"
149-
val maybeTagPageAIContent = S3.get(location).map { jsonString =>
150-
io.circe.parser.decode[TagPageAIContent](jsonString) match {
149+
val maybeStorylinesContent = S3.get(location).map { jsonString =>
150+
io.circe.parser.decode[StorylinesContent](jsonString) match {
151151
case Right(content) => Some(content)
152152
case Left(error) =>
153153
log.error(s"Error decoding TPSGContent for tag $tag: $error")
154154
None
155155
}
156156
}
157-
maybeTagPageAIContent match {
157+
maybeStorylinesContent match {
158158
case Some(content) => content
159159
case None => log.error("TPSGContent not found for tag: " + tag); None
160160
}

common/app/model/dotcomrendering/DotcomTagPagesRenderingDataModel.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import common.Maps.RichMap
55
import common.commercial.EditionCommercialProperties
66
import conf.Configuration
77
import experiments.ActiveExperiments
8-
import model.{TagPageAIContent, Tags}
8+
import model.{StorylinesContent, Tags}
99
import model.pressed.PressedContent
1010
import navigation.{FooterLinks, Nav}
1111
import org.joda.time.{DateTime, DateTimeZone}
@@ -37,7 +37,7 @@ case class DotcomTagPagesRenderingDataModel(
3737
isAdFreeUser: Boolean,
3838
canonicalUrl: String,
3939
contributionsServiceUrl: String,
40-
tagPageAIContent: Option[TagPageAIContent],
40+
storylinesContent: Option[StorylinesContent],
4141
)
4242

4343
object DotcomTagPagesRenderingDataModel {
@@ -66,7 +66,7 @@ object DotcomTagPagesRenderingDataModel {
6666
"isAdFreeUser" -> model.isAdFreeUser,
6767
"canonicalUrl" -> model.canonicalUrl,
6868
"contributionsServiceUrl" -> model.contributionsServiceUrl,
69-
"TagPageAIContent" -> model.tagPageAIContent,
69+
"storylinesContent" -> model.storylinesContent,
7070
)
7171
}
7272
}
@@ -133,7 +133,7 @@ object DotcomTagPagesRenderingDataModel {
133133
isAdFreeUser = views.support.Commercial.isAdFree(request),
134134
canonicalUrl = CanonicalLink(request, page.metadata.webUrl),
135135
contributionsServiceUrl = Configuration.contributionsService.url,
136-
tagPageAIContent = TagPageAIContent.getContent(page.metadata.id)(request),
136+
storylinesContent = StorylinesContent.getContent(page.metadata.id)(request),
137137
)
138138
}
139139

0 commit comments

Comments
 (0)