diff --git a/src/components/ContentViewer.tsx b/src/components/ContentViewer.tsx
index b9e6869..c4e2a48 100644
--- a/src/components/ContentViewer.tsx
+++ b/src/components/ContentViewer.tsx
@@ -2,7 +2,7 @@ import { PDP, currentProfile } from "@/utils/Common.ts";
import { AllForOne, changeRating, downloadBook, getFromDB } from "@/utils/Fetchers.ts";
import { IBook } from "@/interfaces/IBook.ts";
import { providerEnum } from "@/utils/utils.ts";
-import { ArrowBack, ArrowForward, AutoStories, Check, Close, Done, Download, Edit, Favorite, PlayArrow, QuestionMark, Refresh, YoutubeSearchedFor } from "@mui/icons-material";
+import { ArrowBack, ArrowForward, AutoStories, Check, Close, Done, Download, Edit, Favorite, OpenInNew, PlayArrow, QuestionMark, Refresh, YoutubeSearchedFor } from "@mui/icons-material";
import { Avatar, Box, Chip, CircularProgress, Container, IconButton, Paper, Stack, Tooltip, Typography, styled } from "@mui/material";
import Rating from "@mui/material/Rating/Rating";
import Grid2 from "@mui/material/Unstable_Grid2/Grid2";
@@ -46,6 +46,8 @@ function ContentViewer({ provider, TheBook, type, handleAddBreadcrumbs }: {
};
const APINOTFOUND = /[a-zA-Z]/g.test(TheBook.ID_book);
+ console.log("TheBook", TheBook);
+
const fetchCharacters = async () => {
if (type === "volume") {
if (TheBook.characters !== "null") {
@@ -146,22 +148,31 @@ function ContentViewer({ provider, TheBook, type, handleAddBreadcrumbs }: {
}
}
const handleAsyncBG = async () => {
- if (TheBook.URLCover != null && TheBook.URLCover !== "null") {
- console.log("TheBook.URLCover", TheBook.URLCover);
- const options = {
+ let options;
+ if (TheBook.BG_cover != null && TheBook.BG_cover !== "null") {
+ options = {
+ method: "GET", headers: {
+ "Content-Type": "application/json", "img": TheBook.BG_cover
+ }
+ };
+ } else if (TheBook.URLCover != null && TheBook.URLCover !== "null") {
+ options = {
method: "GET", headers: {
"Content-Type": "application/json", "img": TheBook.URLCover
}
};
- await fetch(PDP + "/img/getPalette/" + currentProfile.getToken, options).then(function (response) {
- return response.text();
- }).then(function (data) {
- const Blurcolors = data;
- setTimeout(function () {
- document.getElementsByTagName("body")[0].style.backgroundColor = Blurcolors;
- }, 500);
- });
+ } else {
+ return "#000000";
}
+ await fetch(PDP + "/img/getPalette/" + currentProfile.getToken, options).then(function (response) {
+ return response.text();
+ }).then(function (data) {
+ const Blurcolors = data;
+ setTimeout(function () {
+ document.getElementsByTagName("body")[0].style.backgroundColor = Blurcolors;
+ }, 500);
+ });
+
};
handleAsyncBG();
}, [TheBook.URLCover]);
@@ -199,7 +210,7 @@ function ContentViewer({ provider, TheBook, type, handleAddBreadcrumbs }: {
}
}
>
-
+
{TheBook.NOM}open_in_new
+ {TheBook.NOM}
: (provider === providerEnum.Anilist) ?
{TheBook.NOM}
:
{TheBook.NOM}
) :
(provider === providerEnum.Marvel) ?
{TheBook.NOM}open_in_new
:
(provider === providerEnum.Anilist) ?
- {TheBook.NOM}
:
- {TheBook.NOM}
+ {TheBook.NOM}
:
+ {TheBook.NOM}
}
- We take care of your comics + {t("overlaymsg_takecare")}
: <>>}