🔧 Refactored bulk unzip endpoint wired up

This commit is contained in:
2022-04-28 22:37:31 -07:00
parent e243d7c795
commit 1fab50a92a

View File

@@ -32,6 +32,7 @@ import {
SS_SEARCH_FAILED,
} from "../constants/action-types";
import { success } from "react-notification-system-redux";
import { removeLeadingPeriod } from "../shared/utils/formatting.utils";
import { isNil, map } from "lodash";
export async function walkFolder(path: string): Promise<Array<IFolderData>> {
@@ -262,14 +263,9 @@ export const extractComicArchive = (path: string) => async (dispatch) => {
},
});
map(extractedComicBookArchive.data, (page) => {
const pathItems = page.filePath.split("/");
const folderName = pathItems[pathItems.length - 2];
const imagePath = encodeURI(
`${LIBRARY_SERVICE_HOST}/${page.containedIn}` +
`/` +
page.name +
page.extension,
);
console.log(page);
const pageFilePath = removeLeadingPeriod(page);
const imagePath = encodeURI(`${LIBRARY_SERVICE_HOST}${pageFilePath}`);
comicBookPages.push(imagePath);
});
dispatch({