mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-04-16 23:14:11 +02:00
Improved subtitle parsing to account for bare colon in title
This commit is contained in:
@@ -21,6 +21,20 @@ describe('parseNfoMetadata', () => {
|
||||
expect(result.subtitle).to.equal('A Novel')
|
||||
})
|
||||
|
||||
it('does not split title on bare colon without space', () => {
|
||||
const nfoText = 'Title: 10:04'
|
||||
const result = parseNfoMetadata(nfoText)
|
||||
expect(result.title).to.equal('10:04')
|
||||
expect(result.subtitle).to.be.undefined
|
||||
})
|
||||
|
||||
it('does not split title on colon between words without space', () => {
|
||||
const nfoText = 'Title: Making the Mission:Impossible Movies'
|
||||
const result = parseNfoMetadata(nfoText)
|
||||
expect(result.title).to.equal('Making the Mission:Impossible Movies')
|
||||
expect(result.subtitle).to.be.undefined
|
||||
})
|
||||
|
||||
it('parses authors', () => {
|
||||
const nfoText = 'Author: F. Scott Fitzgerald'
|
||||
const result = parseNfoMetadata(nfoText)
|
||||
|
||||
Reference in New Issue
Block a user