From 3153bdc5bb71b9d28bc469bdc65978cd05a8d587 Mon Sep 17 00:00:00 2001 From: Cassie Esposito Date: Tue, 24 May 2022 18:49:45 -0700 Subject: [PATCH] Fixed bug that caused scanner to fail to get title when subtitle parsing is off, refactored possibly confusing variable declarations. --- server/utils/scandir.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/utils/scandir.js b/server/utils/scandir.js index f94e015c..d3c73269 100644 --- a/server/utils/scandir.js +++ b/server/utils/scandir.js @@ -216,8 +216,9 @@ 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) - if (parseSubtitle) { var [title, subtitle] = getSubtitle(folder) } // Subtitle can be parsed from the title if user enabled + var [title, subtitle] = parseSubtitle ? getSubtitle(folder) : [folder, null] return { mediaMetadata: {