🏗️ Automatic downloads WIP
This commit is contained in:
@@ -23,15 +23,17 @@ export const TorrentSearchPanel = (props) => {
|
|||||||
url: `${PROWLARR_SERVICE_BASE_URI}/search`,
|
url: `${PROWLARR_SERVICE_BASE_URI}/search`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: {
|
data: {
|
||||||
port: "9696",
|
prowlarrQuery: {
|
||||||
apiKey: "c4f42e265fb044dc81f7e88bd41c3367",
|
port: "9696",
|
||||||
offset: 0,
|
apiKey: "c4f42e265fb044dc81f7e88bd41c3367",
|
||||||
categories: [7030],
|
offset: 0,
|
||||||
query: searchTerm.issueName,
|
categories: [7030],
|
||||||
host: "localhost",
|
query: searchTerm.issueName,
|
||||||
limit: 100,
|
host: "localhost",
|
||||||
type: "search",
|
limit: 100,
|
||||||
indexerIds: [2],
|
type: "search",
|
||||||
|
indexerIds: [2],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import Card from "../shared/Carda";
|
|||||||
import ellipsize from "ellipsize";
|
import ellipsize from "ellipsize";
|
||||||
import { convert } from "html-to-text";
|
import { convert } from "html-to-text";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import "../../shared/utils/i18n.util"; // Ensure you import your i18n configuration
|
import "../../shared/utils/i18n.util";
|
||||||
import PopoverButton from "../shared/PopoverButton";
|
import PopoverButton from "../shared/PopoverButton";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
import { useMutation } from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
COMICVINE_SERVICE_URI,
|
COMICVINE_SERVICE_URI,
|
||||||
LIBRARY_SERVICE_BASE_URI,
|
LIBRARY_SERVICE_BASE_URI,
|
||||||
@@ -38,7 +38,6 @@ export const Search = ({}: ISearchProps): ReactElement => {
|
|||||||
} = useMutation({
|
} = useMutation({
|
||||||
mutationFn: async (data: { search: string; resource: string }) => {
|
mutationFn: async (data: { search: string; resource: string }) => {
|
||||||
const { search, resource } = data;
|
const { search, resource } = data;
|
||||||
console.log(data);
|
|
||||||
return await axios({
|
return await axios({
|
||||||
url: `${COMICVINE_SERVICE_URI}/search`,
|
url: `${COMICVINE_SERVICE_URI}/search`,
|
||||||
method: "GET",
|
method: "GET",
|
||||||
@@ -49,7 +48,7 @@ export const Search = ({}: ISearchProps): ReactElement => {
|
|||||||
limit: "10",
|
limit: "10",
|
||||||
offset: "0",
|
offset: "0",
|
||||||
field_list:
|
field_list:
|
||||||
"id,name,deck,api_detail_url,image,description,volume,cover_date,start_year,count_of_issues,publisher",
|
"id,name,deck,api_detail_url,image,description,volume,cover_date,start_year,count_of_issues,publisher,issue_number",
|
||||||
resources: resource,
|
resources: resource,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -69,9 +68,16 @@ export const Search = ({}: ISearchProps): ReactElement => {
|
|||||||
let issues = [];
|
let issues = [];
|
||||||
switch (resourceType) {
|
switch (resourceType) {
|
||||||
case "issue":
|
case "issue":
|
||||||
const { id, api_detail_url, image } = comicObject;
|
const { id, api_detail_url, image, cover_date, issue_number } =
|
||||||
|
comicObject;
|
||||||
// Add issue metadata
|
// Add issue metadata
|
||||||
issues.push({ id, api_detail_url, image });
|
issues.push({
|
||||||
|
id,
|
||||||
|
api_detail_url,
|
||||||
|
image,
|
||||||
|
coverDate: cover_date,
|
||||||
|
issueNumber: issue_number,
|
||||||
|
});
|
||||||
// Get volume metadata from CV
|
// Get volume metadata from CV
|
||||||
const response = await axios({
|
const response = await axios({
|
||||||
url: `${COMICVINE_SERVICE_URI}/getVolumes`,
|
url: `${COMICVINE_SERVICE_URI}/getVolumes`,
|
||||||
@@ -79,7 +85,7 @@ export const Search = ({}: ISearchProps): ReactElement => {
|
|||||||
data: {
|
data: {
|
||||||
volumeURI: comicObject.volume.api_detail_url,
|
volumeURI: comicObject.volume.api_detail_url,
|
||||||
fieldList:
|
fieldList:
|
||||||
"id,name,deck,api_detail_url,image,description,start_year,count_of_issues,publisher,first_issue,last_issue",
|
"id,name,deck,api_detail_url,image,description,start_year,year,count_of_issues,publisher,first_issue,last_issue",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// set volume metadata key
|
// set volume metadata key
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ export const Navbar2 = (): ReactElement => {
|
|||||||
<li>
|
<li>
|
||||||
{/* Light/Dark Mode toggle */}
|
{/* Light/Dark Mode toggle */}
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<span className="text-gray-600 dark:text-white">Light</span>
|
<span className="text-gray-600 dark:text-white">Dark</span>
|
||||||
<label
|
<label
|
||||||
htmlFor="toggle"
|
htmlFor="toggle"
|
||||||
className="relative inline-flex items-center"
|
className="relative inline-flex items-center"
|
||||||
@@ -117,7 +117,7 @@ export const Navbar2 = (): ReactElement => {
|
|||||||
}`}
|
}`}
|
||||||
></span>
|
></span>
|
||||||
</label>
|
</label>
|
||||||
<span className="text-gray-600 dark:text-white">Dark</span>
|
<span className="text-gray-600 dark:text-white">Light</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user