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