Make series sequence cleanup slighlty less aggressive

This commit is contained in:
mikiher 2024-03-12 13:17:52 +02:00
parent 77559d29bb
commit 29e9216bb1

View File

@ -30,9 +30,7 @@ class Audible {
cleanSeriesSequence(seriesName, sequence) {
if (!sequence) return ''
let updatedSequence = sequence.replace(/Book /, '').trim()
if (updatedSequence.includes(' ')) {
updatedSequence = updatedSequence.split(' ').shift().replace(/,$/, '')
}
updatedSequence = updatedSequence.replace(/(\d+)(, .*)/, '$1').trim()
if (sequence !== updatedSequence) {
Logger.debug(`[Audible] Series "${seriesName}" sequence was cleaned from "${sequence}" to "${updatedSequence}"`)
}