Skip to content

Commit

Permalink
fix(chapters): 🚑 fix typo for startOffsetSec
Browse files Browse the repository at this point in the history
This includes a schema change to fix the problem
  • Loading branch information
djdembeck committed Sep 18, 2021
1 parent e7a623f commit 3e68ef4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/config/models/Book.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const bookSchema = schema({
{
lengthMs: types.number({ required: true }),
startOffsetMs: types.number({ required: true }),
startffsetSec: types.number({ required: true }),
startOffsetSec: types.number({ required: true }),
title: types.string({ required: true })
}
), { required: true }
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/audibleChapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class ChapterHelper {

chapJson.lengthMs = chapter.length_ms
chapJson.startOffsetMs = chapter.start_offset_ms
chapJson.startffsetSec = chapter.start_offset_sec
chapJson.startOffsetSec = chapter.start_offset_sec
chapJson.title = this.chapterTitleCleanup(chapter.title)

chapArr.push(chapJson)
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/books/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AuthorInterface, NarratorInterface } from '../people/index'
export interface ApiSingleChapterInterface {
lengthMs: number,
startOffsetMs: number,
startffsetSec: number,
startOffsetSec: number,
title: string
}

Expand Down
6 changes: 3 additions & 3 deletions tests/audible/audibleChapters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('When parsing The Seep', () => {
})

it('returned chapter #4 start_offset_sec', () => {
expect(response.chapters[3].startffsetSec).toBe(139)
expect(response.chapters[3].startOffsetSec).toBe(139)
})

it('returned chapter #4 title', () => {
Expand All @@ -135,8 +135,8 @@ describe('When parsing The Seep', () => {
expect(response.chapters[23].startOffsetMs).toBe(10171073)
})

it('returned chapter #18 startffsetSec', () => {
expect(response.chapters[23].startffsetSec).toBe(10171)
it('returned chapter #18 startOffsetSec', () => {
expect(response.chapters[23].startOffsetSec).toBe(10171)
})

it('returned chapter #18 title', () => {
Expand Down

0 comments on commit 3e68ef4

Please sign in to comment.