🔧 Refactoring uncompression methods on client-side
This commit is contained in:
@@ -259,8 +259,10 @@ export const fetchComicVineMatches =
|
|||||||
* @param {any} options Options object
|
* @param {any} options Options object
|
||||||
* @returns {any}
|
* @returns {any}
|
||||||
*/
|
*/
|
||||||
export const extractComicArchive = (path: string, options: any) => async (dispatch) => {
|
export const extractComicArchive =
|
||||||
|
(path: string, options: any): any => async (dispatch) => {
|
||||||
const comicBookPages: string[] = [];
|
const comicBookPages: string[] = [];
|
||||||
|
console.log(options);
|
||||||
dispatch({
|
dispatch({
|
||||||
type: IMS_COMIC_BOOK_ARCHIVE_EXTRACTION_CALL_IN_PROGRESS,
|
type: IMS_COMIC_BOOK_ARCHIVE_EXTRACTION_CALL_IN_PROGRESS,
|
||||||
});
|
});
|
||||||
@@ -272,6 +274,7 @@ export const extractComicArchive = (path: string, options: any) => async (dispat
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
filePath: path,
|
filePath: path,
|
||||||
|
...options,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
map(extractedComicBookArchive.data, (page) => {
|
map(extractedComicBookArchive.data, (page) => {
|
||||||
@@ -284,7 +287,7 @@ export const extractComicArchive = (path: string, options: any) => async (dispat
|
|||||||
type: IMS_COMIC_BOOK_ARCHIVE_EXTRACTION_SUCCESS,
|
type: IMS_COMIC_BOOK_ARCHIVE_EXTRACTION_SUCCESS,
|
||||||
extractedComicBookArchive: comicBookPages,
|
extractedComicBookArchive: comicBookPages,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const searchIssue = (query, options) => async (dispatch) => {
|
export const searchIssue = (query, options) => async (dispatch) => {
|
||||||
dispatch({
|
dispatch({
|
||||||
|
|||||||
@@ -74,7 +74,13 @@ export const ComicDetail = (data: ComicDetailProps): ReactElement => {
|
|||||||
|
|
||||||
const openModal = useCallback((filePath) => {
|
const openModal = useCallback((filePath) => {
|
||||||
setIsOpen(true);
|
setIsOpen(true);
|
||||||
dispatch(extractComicArchive(filePath));
|
dispatch(extractComicArchive(filePath, {
|
||||||
|
type: "full",
|
||||||
|
purpose: "readComicBook",
|
||||||
|
imageResizeOptions: {
|
||||||
|
baseWidth: 275,
|
||||||
|
}
|
||||||
|
}));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const afterOpenModal = useCallback((things) => {
|
const afterOpenModal = useCallback((things) => {
|
||||||
@@ -249,7 +255,7 @@ export const ComicDetail = (data: ComicDetailProps): ReactElement => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* raw file details */}
|
{/* raw file details */}
|
||||||
<div className="column is-three-fifths">
|
<div className="column">
|
||||||
{!isUndefined(rawFileDetails) &&
|
{!isUndefined(rawFileDetails) &&
|
||||||
!isEmpty(rawFileDetails.cover) && (
|
!isEmpty(rawFileDetails.cover) && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import Card from "../Carda";
|
|||||||
export const ComicVineDetails = (props): ReactElement => {
|
export const ComicVineDetails = (props): ReactElement => {
|
||||||
const { data, updatedAt } = props;
|
const { data, updatedAt } = props;
|
||||||
return (
|
return (
|
||||||
<div className="column is-two-thirds">
|
<div className="column is-half">
|
||||||
<div className="comic-detail comicvine-metadata">
|
<div className="comic-detail comicvine-metadata">
|
||||||
<dl>
|
<dl>
|
||||||
<dt>ComicVine Metadata</dt>
|
<dt>ComicVine Metadata</dt>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export const RawFileDetails = (props): ReactElement => {
|
|||||||
const { rawFileDetails, inferredMetadata } = props.data;
|
const { rawFileDetails, inferredMetadata } = props.data;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="comic-detail raw-file-details">
|
<div className="comic-detail raw-file-details column is-three-fifths">
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Raw File Details</dt>
|
<dt>Raw File Details</dt>
|
||||||
<dd className="is-size-7">
|
<dd className="is-size-7">
|
||||||
@@ -38,7 +38,7 @@ export const RawFileDetails = (props): ReactElement => {
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
<div className="content comic-detail raw-file-details mt-3">
|
<div className="content comic-detail raw-file-details mt-3 column is-one-third">
|
||||||
<dl>
|
<dl>
|
||||||
{/* inferred metadata */}
|
{/* inferred metadata */}
|
||||||
<dt>Inferred Issue Metadata</dt>
|
<dt>Inferred Issue Metadata</dt>
|
||||||
|
|||||||
Reference in New Issue
Block a user