diff --git a/README.md b/README.md index c896d29..06a74a1 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,8 @@ For debugging and troubleshooting, you can run this app locally using these step 1. Clone this repo using `git clone https://github.com/rishighan/threetwo.git` 2. `yarn run dev` (you can ignore the warnings) -3. This will open `http://localhost:3050` in your default browser -4. For testing `OPDS` functionality, create a folder called `comics` under `/src/server` and put some comics in there. The `OPDS` feed is accessed to `http://localhost:8050/api/opds` -5. Note that this is simply the UI layer and won't offer anything beyond a scaffold. You have to spin up the microservices locally to get it to work. +3. This will open `http://localhost:5173` in your default browser +4. Note that this is simply the UI layer and won't offer anything beyond a scaffold. You have to spin up the microservices locally to get it to work. ## Troubleshooting diff --git a/src/client/actions/fileops.actions.tsx b/src/client/actions/fileops.actions.tsx index d2669a5..ad95488 100644 --- a/src/client/actions/fileops.actions.tsx +++ b/src/client/actions/fileops.actions.tsx @@ -127,49 +127,50 @@ export const getComicBooks = (options) => async (dispatch) => { * @returns Nothing. * @param payload */ -export const importToDB = (sourceName: string, metadata?: any) => (dispatch) => { - try { - const comicBookMetadata = { - importType: "new", - payload: { - rawFileDetails: { - name: "", - }, - importStatus: { - isImported: true, - tagged: false, - matchedResult: { - score: "0", +export const importToDB = + (sourceName: string, metadata?: any) => (dispatch) => { + try { + const comicBookMetadata = { + importType: "new", + payload: { + rawFileDetails: { + name: "", }, + importStatus: { + isImported: true, + tagged: false, + matchedResult: { + score: "0", + }, + }, + sourcedMetadata: metadata || null, + acquisition: { source: { wanted: true, name: sourceName } }, }, - sourcedMetadata: metadata || null, - acquisition: { source: { wanted: true, name: sourceName } }, - } - }; - dispatch({ - type: IMS_CV_METADATA_IMPORT_CALL_IN_PROGRESS, - }); - return axios - .request({ - url: `${LIBRARY_SERVICE_BASE_URI}/rawImportToDb`, - method: "POST", - data: comicBookMetadata, - // transformResponse: (r: string) => JSON.parse(r), - }) - .then((response) => { - const { data } = response; - dispatch({ - type: IMS_CV_METADATA_IMPORT_SUCCESSFUL, - importResult: data, - }); + }; + dispatch({ + type: IMS_CV_METADATA_IMPORT_CALL_IN_PROGRESS, }); - } catch (error) { - dispatch({ - type: IMS_CV_METADATA_IMPORT_FAILED, - importError: error, - }); - } -}; + return axios + .request({ + url: `${LIBRARY_SERVICE_BASE_URI}/rawImportToDb`, + method: "POST", + data: comicBookMetadata, + // transformResponse: (r: string) => JSON.parse(r), + }) + .then((response) => { + const { data } = response; + dispatch({ + type: IMS_CV_METADATA_IMPORT_SUCCESSFUL, + importResult: data, + }); + }); + } catch (error) { + dispatch({ + type: IMS_CV_METADATA_IMPORT_FAILED, + importError: error, + }); + } + }; export const fetchVolumeGroups = () => async (dispatch) => { try { @@ -254,24 +255,23 @@ export const fetchComicVineMatches = * @returns {any} */ export const extractComicArchive = - (path: string, options: any): any => - async (dispatch) => { - dispatch({ - type: IMS_COMIC_BOOK_ARCHIVE_EXTRACTION_CALL_IN_PROGRESS, - }); - await axios({ - method: "POST", - url: `${LIBRARY_SERVICE_BASE_URI}/uncompressFullArchive`, - headers: { - "Content-Type": "application/json; charset=utf-8", - }, - data: { - filePath: path, - options, - }, - }); - }; + async (dispatch) => { + dispatch({ + type: IMS_COMIC_BOOK_ARCHIVE_EXTRACTION_CALL_IN_PROGRESS, + }); + await axios({ + method: "POST", + url: `${LIBRARY_SERVICE_BASE_URI}/uncompressFullArchive`, + headers: { + "Content-Type": "application/json; charset=utf-8", + }, + data: { + filePath: path, + options, + }, + }); + }; /** * Description @@ -349,4 +349,4 @@ export const analyzeImage = type: IMG_ANALYSIS_DATA_FETCH_SUCCESS, result: foo.data, }); - }; \ No newline at end of file + }; diff --git a/src/client/components/Dashboard/PullList.tsx b/src/client/components/Dashboard/PullList.tsx index a6f50db..9c2ffc8 100644 --- a/src/client/components/Dashboard/PullList.tsx +++ b/src/client/components/Dashboard/PullList.tsx @@ -20,7 +20,7 @@ export const PullList = ({ issues }: PullListProps): ReactElement => { useEffect(() => { dispatch( getWeeklyPullList({ - startDate: "2023-1-25", + startDate: "2023-5-25", pageSize: "15", currentPage: "1", }), diff --git a/src/client/components/Dashboard/RecentlyImported.tsx b/src/client/components/Dashboard/RecentlyImported.tsx index 3e990b7..cf089aa 100644 --- a/src/client/components/Dashboard/RecentlyImported.tsx +++ b/src/client/components/Dashboard/RecentlyImported.tsx @@ -125,7 +125,7 @@ export const RecentlyImported = ({
- +
diff --git a/src/client/components/Library/LibraryGrid.tsx b/src/client/components/Library/LibraryGrid.tsx index a330625..4790e55 100644 --- a/src/client/components/Library/LibraryGrid.tsx +++ b/src/client/components/Library/LibraryGrid.tsx @@ -73,7 +73,7 @@ export const LibraryGrid = (libraryGridProps: ILibraryGridProps) => {
{!isEmpty(sourcedMetadata.comicvine) && ( - + )} {isNil(rawFileDetails) && ( diff --git a/src/client/components/Navbar.tsx b/src/client/components/Navbar.tsx index dc53958..f8dc3c3 100644 --- a/src/client/components/Navbar.tsx +++ b/src/client/components/Navbar.tsx @@ -85,7 +85,7 @@ const Navbar: React.FunctionComponent = (props) => { {downloadProgressTick &&
} {!isUndefined(downloadProgressTick) ? ( -
+
@@ -98,7 +98,7 @@ const Navbar: React.FunctionComponent = (props) => { -
+
{/* AirDC++ Session Information */}

diff --git a/src/client/constants/endpoints.ts b/src/client/constants/endpoints.ts index 4e52efc..ffb760b 100644 --- a/src/client/constants/endpoints.ts +++ b/src/client/constants/endpoints.ts @@ -8,6 +8,7 @@ export const hostURIBuilder = (options: Record): string => { options.apiPath ); }; +console.log(import.meta); export const CORS_PROXY_SERVER_URI = hostURIBuilder({ protocol: "http",