| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ class NewspaperQuery(contentApiClient: ContentApiClient) extends Dates with Logg | |||
| 23 | 23 | ||
| 24 | 24 | val dateForFrontPagePattern = DateTimeFormat.forPattern("EEEE d MMMM y") | |
| 25 | 25 | private val hrefFormat = DateTimeFormat.forPattern("yyyy/MMM/dd").withZone(DateTimeZone.UTC) | |
| 26 | - val FRONT_PAGE_DISPLAY_NAME = "front page" | ||
| 26 | + val FRONT_PAGE_DISPLAY_NAME = "Front page" | ||
| 27 | 27 | val pathToTag = Map("theguardian" -> "theguardian/mainsection", "theobserver" -> "theobserver/news") | |
| 28 | 28 | ||
| 29 | 29 | def fetchLatestGuardianNewspaper()(implicit executionContext: ExecutionContext): Future[List[FaciaContainer]] = { | |
@@ -77,7 +77,7 @@ class NewspaperQuery(contentApiClient: ContentApiClient) extends Dates with Logg | |||
| 77 | 77 | ||
| 78 | 78 | val bookSectionContainers = orderedBookSections.map { list => | |
| 79 | 79 | val content = list.content.map(c => FaciaContentConvert.contentToFaciaContent(c)) | |
| 80 | - bookSectionContainer(Some(list.tag.id), Some(lowercaseDisplayName(list.tag.webTitle)), None, content, orderedBookSections.indexOf(list) + 1, Nil) | ||
| 80 | + bookSectionContainer(Some(list.tag.id), Some(list.tag.webTitle), None, content, orderedBookSections.indexOf(list) + 1, Nil) | ||
| 81 | 81 | } | |
| 82 | 82 | ||
| 83 | 83 | firstPageContainer :: bookSectionContainers | |
@@ -135,8 +135,6 @@ class NewspaperQuery(contentApiClient: ContentApiClient) extends Dates with Logg | |||
| 135 | 135 | ||
| 136 | 136 | private def getNewspaperPageNumber(content: ApiContent) = content.fields.flatMap(_.newspaperPageNumber) | |
| 137 | 137 | ||
| 138 | - def lowercaseDisplayName(s: String): String = if(s.equals("UK news") || s.equals("US news")) s else s.toLowerCase() | ||
| 139 | - | ||
| 140 | 138 | def getPastSundayDateFor(date: DateTime): DateTime = { | |
| 141 | 139 | if(date.getDayOfWeek != DateTimeConstants.SUNDAY) { | |
| 142 | 140 | val daysSinceSunday = DateTimeConstants.SUNDAY - date.getDayOfWeek - 7 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,12 +17,6 @@ import test.{ConfiguredTestSuite, WithMaterializer, WithTestContentApiClient, Wi | |||
| 17 | 17 | lazy val newspaperQuery = new NewspaperQuery(testContentApiClient) | |
| 18 | 18 | ||
| 19 | 19 | "NewspapeQueryTest" - { | |
| 20 | - "lowercase display name except UK news and US news" in { | ||
| 21 | - newspaperQuery.lowercaseDisplayName("International") should be("international") | ||
| 22 | - newspaperQuery.lowercaseDisplayName("UK news") should be("UK news") | ||
| 23 | - newspaperQuery.lowercaseDisplayName("US news") should be("US news") | ||
| 24 | - } | ||
| 25 | - | ||
| 26 | 20 | "use past Sunday date for a given day (required for /theobserver)" in { | |
| 27 | 21 | newspaperQuery.getPastSundayDateFor(new DateTime(2015, 11, 19, 0, 0).withZone(DateTimeZone.UTC)).toISODateTimeString should be("2015-11-15T00:00:00.000Z") | |
| 28 | 22 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments