mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-22 00:07:52 +01:00
This commit is contained in:
parent
7f5356100d
commit
74388fe0b9
@ -102,9 +102,11 @@ const bookMetadataMapper = {
|
|||||||
to: (m) => m.seriesName,
|
to: (m) => m.seriesName,
|
||||||
from: (v) => {
|
from: (v) => {
|
||||||
return commaSeparatedToArray(v).map(series => { // Return array of { name, sequence }
|
return commaSeparatedToArray(v).map(series => { // Return array of { name, sequence }
|
||||||
var sequence = null
|
let sequence = null
|
||||||
var name = series
|
let name = series
|
||||||
var matchResults = series.match(/ #((?:\d*\.?\d+)|(?:\.?\d*))$/) // Pull out sequence #
|
// Series sequence match any characters after " #" other than whitespace and another #
|
||||||
|
// e.g. "Name #1a" is valid. "Name #1#a" or "Name #1 a" is not valid.
|
||||||
|
const matchResults = series.match(/ #([^#\s]+)$/) // Pull out sequence #
|
||||||
if (matchResults && matchResults.length && matchResults.length > 1) {
|
if (matchResults && matchResults.length && matchResults.length > 1) {
|
||||||
sequence = matchResults[1] // Group 1
|
sequence = matchResults[1] // Group 1
|
||||||
name = series.replace(matchResults[0], '')
|
name = series.replace(matchResults[0], '')
|
||||||
|
Loading…
Reference in New Issue
Block a user