Merge pull request #632 from cassieesposito/getBookDataFromDir-refactor

URGENT: Fix to serious bug
This commit is contained in:
advplyr 2022-05-24 21:33:40 -05:00 committed by GitHub
commit 97d4330cda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -216,8 +216,9 @@ function getBookDataFromDir(folderPath, relPath, parseSubtitle = false) {
// The may contain various other pieces of metadata, these functions extract it. // The may contain various other pieces of metadata, these functions extract it.
var [folder, narrators] = getNarrator(folder) var [folder, narrators] = getNarrator(folder)
if (series) { var [folder, sequence] = getSequence(folder) } if (series) { var [folder, sequence] = getSequence(folder) }
var [folder, sequence] = series ? getSequence(folder) : [folder, null]
var [folder, publishedYear] = getPublishedYear(folder) 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 { return {
mediaMetadata: { mediaMetadata: {
@ -330,10 +331,12 @@ async function getLibraryItemFileData(libraryMediaType, folder, libraryItemPath,
var fileItems = [] var fileItems = []
if (isSingleMediaItem) { // Single media item in root of folder if (isSingleMediaItem) { // Single media item in root of folder
fileItems = [{ fileItems = [
{
fullpath: libraryItemPath, fullpath: libraryItemPath,
path: libraryItemDir // actually the relPath (only filename here) path: libraryItemDir // actually the relPath (only filename here)
}] }
]
libraryItemData = { libraryItemData = {
path: libraryItemPath, // full path path: libraryItemPath, // full path
relPath: libraryItemDir, // only filename relPath: libraryItemDir, // only filename