From 6846de98f894f7a347a89f8777bd5b8c5047b49f Mon Sep 17 00:00:00 2001 From: Cassie Esposito Date: Sun, 5 Jun 2022 15:52:18 -0700 Subject: [PATCH] Fixed bugs that caused getSequence to run twice and broke year recognition --- server/utils/scandir.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/utils/scandir.js b/server/utils/scandir.js index 917c319e..f60a5ebd 100644 --- a/server/utils/scandir.js +++ b/server/utils/scandir.js @@ -216,7 +216,6 @@ function getBookDataFromDir(folderPath, relPath, parseSubtitle = false) { // The may contain various other pieces of metadata, these functions extract it. var [folder, narrators] = getNarrator(folder) - if (series) { var [folder, sequence] = getSequence(folder) } var [folder, sequence] = series ? getSequence(folder) : [folder, null] var [folder, publishedYear] = getPublishedYear(folder) var [title, subtitle] = parseSubtitle ? getSubtitle(folder) : [folder, null] @@ -258,7 +257,7 @@ function getSequence(folder) { // ] // Matches a valid volume string. Also matches a book whose title starts with a 1 to 3 digit number. Will handle that later. - let pattern = /^(?vol\.? |volume |book )?(?\d{1,3}(?:\.\d{1,2})?)(?\.?)(?: (?.*))?/i + let pattern = /^(?vol\.? |volume |book )?(?\d{1,3}(?:\.\d{1,2})?)(?\.?)(?: (?.*))?$/i let volumeNumber = null let parts = folder.split(' - ')