🔎 DC++ manual search scaffold

This commit is contained in:
2022-04-19 01:01:34 -07:00
parent 253c7357a0
commit d17f49baf4
4 changed files with 186 additions and 150 deletions

View File

@@ -1,8 +1,9 @@
import axios from "axios";
import rateLimiter from "axios-rate-limit";
import { AxiosCacheRequestConfig, createCacheAdapter } from 'axios-simple-cache-adapter';
import {
AxiosCacheRequestConfig,
createCacheAdapter,
} from "axios-simple-cache-adapter";
import qs from "qs";
import {
CV_SEARCH_SUCCESS,
@@ -25,7 +26,6 @@ import {
LIBRARY_SERVICE_BASE_URI,
} from "../constants/endpoints";
const axiosCacheAdapter = createCacheAdapter();
const http = rateLimiter(axios.create(), {
maxRequests: 1,
@@ -39,7 +39,6 @@ export const getWeeklyPullList = (options) => async (dispatch) => {
type: CV_WEEKLY_PULLLIST_CALL_IN_PROGRESS,
});
await axios(`${COMICVINE_SERVICE_URI}/getWeeklyPullList`, {
method: "get",
params: options,
@@ -145,7 +144,7 @@ export const analyzeLibrary = (issues) => async (dispatch) => {
});
};
export const getLibraryStatistics = () => async dispatch => {
export const getLibraryStatistics = () => async (dispatch) => {
dispatch({
type: LIBRARY_STATISTICS_CALL_IN_PROGRESS,
});

View File

@@ -52,15 +52,9 @@ export async function walkFolder(path: string): Promise<Array<IFolderData>> {
}
/**
* Fetches comic book covers along with some metadata
*
* using {@link Renderer}.
*
* Used by external plugins
*
* @param {Object} options
* @return {Promise<string>} HTML of the page
* @return the comic book metadata
*/
export const fetchComicBookMetadata = (options) => async (dispatch) => {
export const fetchComicBookMetadata = () => async (dispatch) => {
const extractionOptions = {
extractTarget: "cover",
targetExtractionFolder: "./userdata/covers",
@@ -97,6 +91,11 @@ export const toggleImportQueueStatus = (options) => async (dispatch) => {
data: { manjhul: "jigyadam", action: options.action },
});
};
/**
* Fetches comic book metadata for various types
* @return metadata for the comic book object categories
* @param options
**/
export const getComicBooks = (options) => async (dispatch) => {
const { paginationOptions, predicate, comicStatus } = options;
@@ -127,6 +126,11 @@ export const getComicBooks = (options) => async (dispatch) => {
}
};
/**
* Makes a call to library service to import the comic book metadata into the ThreeTwo data store.
* @returns Nothing.
* @param payload
*/
export const importToDB = (payload?: any) => (dispatch) => {
try {
const comicBookMetadata = {
@@ -164,6 +168,7 @@ export const importToDB = (payload?: any) => (dispatch) => {
});
}
};
export const fetchVolumeGroups = () => async (dispatch) => {
try {
dispatch({