🔧 Renamed IMPORT_* to LIBRARY_*
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
} from "../shared/utils/formatting.utils";
|
||||
import { isUndefined, isEmpty, isNil } from "lodash";
|
||||
import { Link } from "react-router-dom";
|
||||
import { IMPORT_SERVICE_HOST } from "../constants/endpoints";
|
||||
import { LIBRARY_SERVICE_HOST } from "../constants/endpoints";
|
||||
import ellipsize from "ellipsize";
|
||||
|
||||
interface IProps {
|
||||
@@ -27,7 +27,7 @@ class Card extends React.Component<IProps, IState> {
|
||||
metadata: IExtractedComicBookCoverFile,
|
||||
): JSX.Element => {
|
||||
const encodedFilePath = encodeURI(
|
||||
`${IMPORT_SERVICE_HOST}` + removeLeadingPeriod(metadata.path),
|
||||
`${LIBRARY_SERVICE_HOST}` + removeLeadingPeriod(metadata.path),
|
||||
);
|
||||
const filePath = escapePoundSymbol(encodedFilePath);
|
||||
return (
|
||||
|
||||
@@ -24,7 +24,7 @@ import SlidingPane from "react-sliding-pane";
|
||||
|
||||
import { escapePoundSymbol } from "../shared/utils/formatting.utils";
|
||||
|
||||
import { IMPORT_SERVICE_HOST } from "../constants/endpoints";
|
||||
import { LIBRARY_SERVICE_HOST } from "../constants/endpoints";
|
||||
import { getSettings } from "../actions/settings.actions";
|
||||
import { AirDCPPSocketContext } from "../context/AirDCPPSocket";
|
||||
import AirDCPPSocket from "../services/DcppSearchService";
|
||||
@@ -210,7 +210,7 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
|
||||
let comicBookTitle = "";
|
||||
if (!isNil(comicBookDetailData.rawFileDetails)) {
|
||||
const encodedFilePath = encodeURI(
|
||||
`${IMPORT_SERVICE_HOST}/${comicBookDetailData.rawFileDetails.cover.filePath}`,
|
||||
`${LIBRARY_SERVICE_HOST}/${comicBookDetailData.rawFileDetails.cover.filePath}`,
|
||||
);
|
||||
imagePath = escapePoundSymbol(encodedFilePath);
|
||||
comicBookTitle = comicBookDetailData.rawFileDetails.name;
|
||||
|
||||
@@ -32,7 +32,15 @@ export const Dashboard = (): ReactElement => {
|
||||
|
||||
{!isEmpty(recentComics) && !isEmpty(recentComics.docs) ? (
|
||||
<>
|
||||
<div className="columns">
|
||||
<div className="column is-half card">
|
||||
<div className="card-content">
|
||||
<h1 className="is-size-5">13,476 Books</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<RecentlyImported comicBookCovers={recentComics} />
|
||||
|
||||
{!isNil(volumeGroups) ? <VolumeGroups /> : null}
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -3,13 +3,13 @@ import PropTypes from "prop-types";
|
||||
import { escapePoundSymbol } from "../../shared/utils/formatting.utils";
|
||||
import prettyBytes from "pretty-bytes";
|
||||
import ellipsize from "ellipsize";
|
||||
import { IMPORT_SERVICE_HOST } from "../../constants/endpoints";
|
||||
import { LIBRARY_SERVICE_HOST } from "../../constants/endpoints";
|
||||
|
||||
// raw file details
|
||||
export const RawFileDetails = (rawFileData): ReactElement => {
|
||||
const { data } = rawFileData;
|
||||
const encodedFilePath = encodeURI(
|
||||
`${IMPORT_SERVICE_HOST}/${data.cover.filePath}`,
|
||||
`${LIBRARY_SERVICE_HOST}/${data.cover.filePath}`,
|
||||
);
|
||||
const filePath = escapePoundSymbol(encodedFilePath);
|
||||
return (
|
||||
|
||||
@@ -15,7 +15,7 @@ import Masonry from "react-masonry-css";
|
||||
import Card from "./Carda";
|
||||
import { detectIssueTypes } from "../shared/utils/tradepaperback.utils";
|
||||
import { Link } from "react-router-dom";
|
||||
import { IMPORT_SERVICE_HOST } from "../constants/endpoints";
|
||||
import { LIBRARY_SERVICE_HOST } from "../constants/endpoints";
|
||||
|
||||
interface ILibraryGridProps {}
|
||||
export const LibraryGrid = (libraryGridProps: ILibraryGridProps) => {
|
||||
@@ -47,7 +47,7 @@ export const LibraryGrid = (libraryGridProps: ILibraryGridProps) => {
|
||||
let comicName = "";
|
||||
if (!isNil(rawFileDetails)) {
|
||||
const encodedFilePath = encodeURI(
|
||||
`${IMPORT_SERVICE_HOST}` +
|
||||
`${LIBRARY_SERVICE_HOST}` +
|
||||
removeLeadingPeriod(rawFileDetails.cover.filePath),
|
||||
);
|
||||
imagePath = escapePoundSymbol(encodedFilePath);
|
||||
|
||||
@@ -6,7 +6,7 @@ import { escapePoundSymbol } from "../shared/utils/formatting.utils";
|
||||
import { isNil, isUndefined, map } from "lodash";
|
||||
import { detectIssueTypes } from "../shared/utils/tradepaperback.utils";
|
||||
import Masonry from "react-masonry-css";
|
||||
import { IMPORT_SERVICE_HOST } from "../constants/endpoints";
|
||||
import { LIBRARY_SERVICE_HOST } from "../constants/endpoints";
|
||||
|
||||
type RecentlyImportedProps = {
|
||||
comicBookCovers: any;
|
||||
@@ -19,7 +19,7 @@ export const RecentlyImported = ({
|
||||
default: 5,
|
||||
1100: 4,
|
||||
700: 2,
|
||||
600: 1,
|
||||
600: 2,
|
||||
};
|
||||
return (
|
||||
<>
|
||||
@@ -38,7 +38,7 @@ export const RecentlyImported = ({
|
||||
let comicName = "";
|
||||
if (!isNil(rawFileDetails)) {
|
||||
const encodedFilePath = encodeURI(
|
||||
`${IMPORT_SERVICE_HOST}/${rawFileDetails.cover.filePath}`,
|
||||
`${LIBRARY_SERVICE_HOST}/${rawFileDetails.cover.filePath}`,
|
||||
);
|
||||
imagePath = escapePoundSymbol(encodedFilePath);
|
||||
comicName = rawFileDetails.name;
|
||||
|
||||
@@ -4,8 +4,9 @@ import { useDispatch, useSelector } from "react-redux";
|
||||
import { getComicBooksDetailsByIds } from "../../actions/comicinfo.actions";
|
||||
import { Card } from "../Carda";
|
||||
import ellipsize from "ellipsize";
|
||||
import { IMPORT_SERVICE_HOST } from "../../constants/endpoints";
|
||||
import { LIBRARY_SERVICE_HOST } from "../../constants/endpoints";
|
||||
import { escapePoundSymbol } from "../../shared/utils/formatting.utils";
|
||||
import prettyBytes from "pretty-bytes";
|
||||
|
||||
const PotentialLibraryMatches = (props): ReactElement => {
|
||||
const dispatch = useDispatch();
|
||||
@@ -20,13 +21,11 @@ const PotentialLibraryMatches = (props): ReactElement => {
|
||||
{isArray(comicBooks) ? (
|
||||
map(comicBooks, (match) => {
|
||||
const encodedFilePath = encodeURI(
|
||||
`${IMPORT_SERVICE_HOST}/${match.rawFileDetails.cover.filePath}`,
|
||||
`${LIBRARY_SERVICE_HOST}/${match.rawFileDetails.cover.filePath}`,
|
||||
);
|
||||
const filePath = escapePoundSymbol(encodedFilePath);
|
||||
return (
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(match, undefined, 2)}</pre> */}
|
||||
|
||||
<div className="potential-issue-match mb-3">
|
||||
<div className="columns">
|
||||
<div className="column is-one-fifth">
|
||||
<Card
|
||||
@@ -38,9 +37,9 @@ const PotentialLibraryMatches = (props): ReactElement => {
|
||||
|
||||
<div className="search-result-details column">
|
||||
<div className="is-size-5">{match.rawFileDetails.name}</div>
|
||||
<span className="subtitle is-size-7">
|
||||
{match.rawFileDetails.cover.filePath}
|
||||
</span>
|
||||
<pre className="code is-size-7">
|
||||
{match.rawFileDetails.containedIn}
|
||||
</pre>
|
||||
<div className="field is-grouped is-grouped-multiline mt-4">
|
||||
<div className="control">
|
||||
<div className="tags has-addons">
|
||||
@@ -54,17 +53,14 @@ const PotentialLibraryMatches = (props): ReactElement => {
|
||||
<div className="tags has-addons">
|
||||
<span className="tag">File Size</span>
|
||||
<span className="tag is-warning">
|
||||
{match.rawFileDetails.fileSize}
|
||||
{prettyBytes(match.rawFileDetails.fileSize)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* <div className="is-size-7">
|
||||
{ellipsize(issueDescription, 300)}
|
||||
</div> */}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
) : (
|
||||
|
||||
@@ -82,8 +82,8 @@ const VolumeDetails = (props): ReactElement => {
|
||||
<span className="icon has-text-success">
|
||||
<i className="fa-regular fa-clone"></i>
|
||||
</span>
|
||||
<span className="is-primary is-size-7">
|
||||
{issue.issue.issue_number}
|
||||
<span className="tag is-light is-warning is-size-7">
|
||||
{"#" + issue.issue.issue_number}
|
||||
</span>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user