🔧 Moved metadata panels to its own component

This commit is contained in:
Rishi Ghan
2022-05-24 14:03:07 -07:00
parent a156f07598
commit d50a5ada02
7 changed files with 175 additions and 348 deletions

View File

@@ -13,19 +13,24 @@ export const determineCoverFile = (data) => {
*/
const coverFile = {
rawFile: {
objectReference: "rawFileDetails",
priority: 1,
url: "",
issueName: "",
},
comicvine: {
objectReference: "comicvine",
priority: 2,
url: "",
issueName: "",
publisher: "",
},
locg: {
objectReference: "locg",
priority: 3,
url: "",
issueName: "",
publisher: "",
},
};
if (
@@ -34,6 +39,7 @@ export const determineCoverFile = (data) => {
) {
coverFile.comicvine.url = data.comicvine.image.small_url;
coverFile.comicvine.issueName = data.comicvine.name;
coverFile.comicvine.publisher = data.comicvine.volumeInformation.publisher;
}
if (!isEmpty(data.rawFileDetails.cover)) {
const encodedFilePath = encodeURI(
@@ -45,6 +51,7 @@ export const determineCoverFile = (data) => {
if (!isUndefined(data.locg)) {
coverFile.locg.url = data.locg.cover;
coverFile.locg.issueName = data.locg.name;
coverFile.locg.publisher = data.locg.publisher;
}
const result = filter(coverFile, (item) => item.url !== "");