fix(name): fix name route crash
this commit fixes a crash in name route caused by upstream closes https://github.com/zyachel/libremdb/issues/51
This commit is contained in:
parent
c610ef4d1b
commit
38ed0c6217
@ -39,10 +39,12 @@ const Basic = ({ data, className }: Props) => {
|
|||||||
{data.bio.short}...
|
{data.bio.short}...
|
||||||
</p>
|
</p>
|
||||||
}
|
}
|
||||||
|
{data.knownFor.title && (
|
||||||
<p className={styles.genres}>
|
<p className={styles.genres}>
|
||||||
<span className={styles.heading}>Known for: </span>
|
<span className={styles.heading}>Known for: </span>
|
||||||
{data.knownFor.title} ({data.knownFor.role})
|
{data.knownFor.title} ({data.knownFor.role})
|
||||||
</p>
|
</p>
|
||||||
|
)}
|
||||||
</CardBasic>
|
</CardBasic>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -6,13 +6,13 @@ export default interface Name {
|
|||||||
nameText: {
|
nameText: {
|
||||||
text: string;
|
text: string;
|
||||||
};
|
};
|
||||||
disambiguator?: {
|
|
||||||
text: string;
|
|
||||||
};
|
|
||||||
/*
|
/*
|
||||||
searchIndexing: {
|
searchIndexing: {
|
||||||
disableIndexing: boolean
|
disableIndexing: boolean
|
||||||
}*/
|
}*/
|
||||||
|
disambiguator?: {
|
||||||
|
text: string;
|
||||||
|
};
|
||||||
knownFor: {
|
knownFor: {
|
||||||
edges: Array<{
|
edges: Array<{
|
||||||
node: {
|
node: {
|
||||||
@ -49,18 +49,17 @@ export default interface Name {
|
|||||||
publicationStatus: string
|
publicationStatus: string
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
primaryProfessions: Array<{
|
|
||||||
category: {
|
|
||||||
text: string;
|
|
||||||
};
|
|
||||||
}>;
|
|
||||||
bio: {
|
bio: {
|
||||||
text: {
|
text: {
|
||||||
plainText: string;
|
plainText: string;
|
||||||
plaidHtml: string;
|
plaidHtml: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
primaryProfessions: Array<{
|
||||||
|
category: {
|
||||||
|
text: string;
|
||||||
|
};
|
||||||
|
}>;
|
||||||
birthDate: {
|
birthDate: {
|
||||||
displayableProperty: {
|
displayableProperty: {
|
||||||
value: {
|
value: {
|
||||||
@ -105,6 +104,9 @@ export default interface Name {
|
|||||||
subNavAwardNominations: {
|
subNavAwardNominations: {
|
||||||
total: number;
|
total: number;
|
||||||
};
|
};
|
||||||
|
subNavFaqs: {
|
||||||
|
total: number;
|
||||||
|
};
|
||||||
// videos: {
|
// videos: {
|
||||||
// total: number;
|
// total: number;
|
||||||
// };
|
// };
|
||||||
@ -222,185 +224,21 @@ export default interface Name {
|
|||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
// primaryImage: {
|
/*
|
||||||
// id: string;
|
|
||||||
// caption: {
|
|
||||||
// plainText: string;
|
|
||||||
// };
|
|
||||||
// height: number;
|
|
||||||
// width: number;
|
|
||||||
// url: string;
|
|
||||||
// };
|
|
||||||
// imageUploadLink: null;
|
|
||||||
// nameText: {
|
|
||||||
// text: string;
|
|
||||||
// };
|
|
||||||
knownFor: {
|
|
||||||
edges: Array<{
|
|
||||||
node: {
|
|
||||||
summary: {
|
|
||||||
attributes?: Array<{
|
|
||||||
text: string;
|
|
||||||
}>;
|
|
||||||
episodeCount?: number;
|
|
||||||
principalCategory: {
|
|
||||||
text: string;
|
|
||||||
id: string;
|
|
||||||
};
|
|
||||||
principalCharacters?: Array<{
|
|
||||||
name: string;
|
|
||||||
}>;
|
|
||||||
principalJobs?: Array<{
|
|
||||||
id: string;
|
|
||||||
text: string;
|
|
||||||
}>;
|
|
||||||
yearRange: {
|
|
||||||
year: number;
|
|
||||||
endYear?: number;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
credit: {
|
|
||||||
attributes?: Array<{
|
|
||||||
text: string;
|
|
||||||
}>;
|
|
||||||
category: {
|
|
||||||
id: string;
|
|
||||||
text: string;
|
|
||||||
};
|
|
||||||
characters?: Array<{
|
|
||||||
name: string;
|
|
||||||
}>;
|
|
||||||
episodeCredits: {
|
|
||||||
total: number;
|
|
||||||
yearRange?: {
|
|
||||||
year: number;
|
|
||||||
endYear: number;
|
|
||||||
};
|
|
||||||
displayableYears: {
|
|
||||||
total: number;
|
|
||||||
edges: Array<{
|
|
||||||
node: {
|
|
||||||
year: string;
|
|
||||||
displayableProperty: {
|
|
||||||
value: {
|
|
||||||
plainText: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
displayableSeasons: {
|
|
||||||
total: number;
|
|
||||||
edges: Array<{
|
|
||||||
node: {
|
|
||||||
season: string;
|
|
||||||
displayableProperty: {
|
|
||||||
value: {
|
|
||||||
plainText: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
jobs?: Array<{
|
|
||||||
id: string;
|
|
||||||
text: string;
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
title: {
|
|
||||||
id: string;
|
|
||||||
canRate: {
|
|
||||||
isRatable: boolean;
|
|
||||||
};
|
|
||||||
certificate?: {
|
|
||||||
rating: string;
|
|
||||||
};
|
|
||||||
originalTitleText: {
|
|
||||||
text: string;
|
|
||||||
};
|
|
||||||
titleText: {
|
|
||||||
text: string;
|
|
||||||
};
|
|
||||||
titleType: {
|
|
||||||
canHaveEpisodes: boolean;
|
|
||||||
displayableProperty: {
|
|
||||||
value: {
|
|
||||||
plainText: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
text: string;
|
|
||||||
id: 'movie' | 'tvSeries' | 'tvEpisode' | 'videoGame';
|
|
||||||
};
|
|
||||||
primaryImage: {
|
primaryImage: {
|
||||||
id: string;
|
id: string;
|
||||||
url: string;
|
|
||||||
height: number;
|
|
||||||
width: number;
|
|
||||||
caption: {
|
caption: {
|
||||||
plainText: string;
|
plainText: string;
|
||||||
};
|
};
|
||||||
|
height: number;
|
||||||
|
width: number;
|
||||||
|
url: string;
|
||||||
};
|
};
|
||||||
ratingsSummary: {
|
imageUploadLink: null;
|
||||||
aggregateRating?: number;
|
nameText: {
|
||||||
voteCount: number;
|
|
||||||
};
|
|
||||||
latestTrailer?: {
|
|
||||||
id: string;
|
|
||||||
};
|
|
||||||
releaseYear: {
|
|
||||||
year: number;
|
|
||||||
endYear?: number;
|
|
||||||
};
|
|
||||||
runtime?: {
|
|
||||||
seconds: number;
|
|
||||||
};
|
|
||||||
series: null;
|
|
||||||
episodes?: {
|
|
||||||
displayableSeasons: {
|
|
||||||
total: number;
|
|
||||||
edges: Array<{
|
|
||||||
node: {
|
|
||||||
season: string;
|
|
||||||
displayableProperty: {
|
|
||||||
value: {
|
|
||||||
plainText: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
displayableYears: {
|
|
||||||
total: number;
|
|
||||||
edges: Array<{
|
|
||||||
node: {
|
|
||||||
year: string;
|
|
||||||
displayableProperty: {
|
|
||||||
value: {
|
|
||||||
plainText: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
titleGenres: {
|
|
||||||
genres: Array<{
|
|
||||||
genre: {
|
|
||||||
text: string;
|
text: string;
|
||||||
};
|
};
|
||||||
}>;
|
*/
|
||||||
};
|
|
||||||
productionStatus: {
|
|
||||||
currentProductionStage: {
|
|
||||||
id: string;
|
|
||||||
text: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}>;
|
|
||||||
};
|
|
||||||
primaryProfessions: Array<{
|
primaryProfessions: Array<{
|
||||||
category: {
|
category: {
|
||||||
text: string;
|
text: string;
|
||||||
@ -753,6 +591,172 @@ export default interface Name {
|
|||||||
};
|
};
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
|
knownForFeature: {
|
||||||
|
edges: Array<{
|
||||||
|
node: {
|
||||||
|
summary: {
|
||||||
|
attributes?: Array<{
|
||||||
|
text: string;
|
||||||
|
}>;
|
||||||
|
episodeCount?: number;
|
||||||
|
principalCategory: {
|
||||||
|
text: string;
|
||||||
|
id: string;
|
||||||
|
};
|
||||||
|
principalCharacters?: Array<{
|
||||||
|
name: string;
|
||||||
|
}>;
|
||||||
|
principalJobs?: Array<{
|
||||||
|
id: string;
|
||||||
|
text: string;
|
||||||
|
}>;
|
||||||
|
yearRange: {
|
||||||
|
year: number;
|
||||||
|
endYear?: number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
credit: {
|
||||||
|
attributes?: Array<{
|
||||||
|
text: string;
|
||||||
|
}>;
|
||||||
|
category: {
|
||||||
|
id: string;
|
||||||
|
text: string;
|
||||||
|
};
|
||||||
|
characters?: Array<{
|
||||||
|
name: string;
|
||||||
|
}>;
|
||||||
|
episodeCredits: {
|
||||||
|
total: number;
|
||||||
|
yearRange?: {
|
||||||
|
year: number;
|
||||||
|
endYear: number;
|
||||||
|
};
|
||||||
|
displayableYears: {
|
||||||
|
total: number;
|
||||||
|
edges: Array<{
|
||||||
|
node: {
|
||||||
|
year: string;
|
||||||
|
displayableProperty: {
|
||||||
|
value: {
|
||||||
|
plainText: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}>;
|
||||||
|
};
|
||||||
|
displayableSeasons: {
|
||||||
|
total: number;
|
||||||
|
edges: Array<{
|
||||||
|
node: {
|
||||||
|
season: string;
|
||||||
|
displayableProperty: {
|
||||||
|
value: {
|
||||||
|
plainText: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
jobs?: Array<{
|
||||||
|
id: string;
|
||||||
|
text: string;
|
||||||
|
}>;
|
||||||
|
};
|
||||||
|
title: {
|
||||||
|
id: string;
|
||||||
|
canRate: {
|
||||||
|
isRatable: boolean;
|
||||||
|
};
|
||||||
|
certificate?: {
|
||||||
|
rating: string;
|
||||||
|
};
|
||||||
|
originalTitleText: {
|
||||||
|
text: string;
|
||||||
|
};
|
||||||
|
titleText: {
|
||||||
|
text: string;
|
||||||
|
};
|
||||||
|
titleType: {
|
||||||
|
canHaveEpisodes: boolean;
|
||||||
|
displayableProperty: {
|
||||||
|
value: {
|
||||||
|
plainText: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
text: string;
|
||||||
|
id: 'movie' | 'tvSeries' | 'tvEpisode' | 'videoGame';
|
||||||
|
};
|
||||||
|
primaryImage: {
|
||||||
|
id: string;
|
||||||
|
url: string;
|
||||||
|
height: number;
|
||||||
|
width: number;
|
||||||
|
caption: {
|
||||||
|
plainText: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
ratingsSummary: {
|
||||||
|
aggregateRating?: number;
|
||||||
|
voteCount: number;
|
||||||
|
};
|
||||||
|
latestTrailer?: {
|
||||||
|
id: string;
|
||||||
|
};
|
||||||
|
releaseYear: {
|
||||||
|
year: number;
|
||||||
|
endYear?: number;
|
||||||
|
};
|
||||||
|
runtime?: {
|
||||||
|
seconds: number;
|
||||||
|
};
|
||||||
|
series: null;
|
||||||
|
episodes?: {
|
||||||
|
displayableSeasons: {
|
||||||
|
total: number;
|
||||||
|
edges: Array<{
|
||||||
|
node: {
|
||||||
|
season: string;
|
||||||
|
displayableProperty: {
|
||||||
|
value: {
|
||||||
|
plainText: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}>;
|
||||||
|
};
|
||||||
|
displayableYears: {
|
||||||
|
total: number;
|
||||||
|
edges: Array<{
|
||||||
|
node: {
|
||||||
|
year: string;
|
||||||
|
displayableProperty: {
|
||||||
|
value: {
|
||||||
|
plainText: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
titleGenres: {
|
||||||
|
genres: Array<{
|
||||||
|
genre: {
|
||||||
|
text: string;
|
||||||
|
};
|
||||||
|
}>;
|
||||||
|
};
|
||||||
|
productionStatus: {
|
||||||
|
currentProductionStage: {
|
||||||
|
id: string;
|
||||||
|
text: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}>;
|
||||||
|
};
|
||||||
videos: {
|
videos: {
|
||||||
total: number;
|
total: number;
|
||||||
edges: Array<{
|
edges: Array<{
|
||||||
@ -799,18 +803,20 @@ export default interface Name {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
// birthDate: {
|
/*
|
||||||
// dateComponents: {
|
birthDate: {
|
||||||
// day?: number;
|
dateComponents: {
|
||||||
// month?: number;
|
day?: number;
|
||||||
// year: number;
|
month?: number;
|
||||||
// };
|
year: number;
|
||||||
// displayableProperty: {
|
};
|
||||||
// value: {
|
displayableProperty: {
|
||||||
// plainText: string;
|
value: {
|
||||||
// };
|
plainText: string;
|
||||||
// };
|
};
|
||||||
// };
|
};
|
||||||
|
};
|
||||||
|
*/
|
||||||
birthLocation: {
|
birthLocation: {
|
||||||
text: string;
|
text: string;
|
||||||
displayableProperty: {
|
displayableProperty: {
|
||||||
@ -819,18 +825,20 @@ export default interface Name {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
// deathDate?: {
|
/*
|
||||||
// dateComponents: {
|
deathDate?: {
|
||||||
// day?: number;
|
dateComponents: {
|
||||||
// month?: number;
|
day?: number;
|
||||||
// year: number;
|
month?: number;
|
||||||
// };
|
year: number;
|
||||||
// displayableProperty: {
|
};
|
||||||
// value: {
|
displayableProperty: {
|
||||||
// plainText: string;
|
value: {
|
||||||
// };
|
plainText: string;
|
||||||
// };
|
};
|
||||||
// };
|
};
|
||||||
|
};
|
||||||
|
*/
|
||||||
deathLocation?: {
|
deathLocation?: {
|
||||||
text: string;
|
text: string;
|
||||||
displayableProperty: {
|
displayableProperty: {
|
||||||
|
@ -14,8 +14,8 @@ const cleanName = (rawData: RawName) => {
|
|||||||
name: main.nameText.text,
|
name: main.nameText.text,
|
||||||
nameSuffix: main.disambiguator?.text ?? null,
|
nameSuffix: main.disambiguator?.text ?? null,
|
||||||
knownFor: {
|
knownFor: {
|
||||||
title: main.knownFor.edges[0].node.title.titleText.text,
|
title: main.knownFor.edges[0]?.node.title.titleText.text ?? null,
|
||||||
role: main.knownFor.edges[0].node.summary.principalCategory.text,
|
role: main.knownFor.edges[0]?.node.summary.principalCategory.text ?? null,
|
||||||
},
|
},
|
||||||
...(main.primaryImage && {
|
...(main.primaryImage && {
|
||||||
poster: {
|
poster: {
|
||||||
@ -87,7 +87,7 @@ const cleanName = (rawData: RawName) => {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
knownFor: misc.knownFor.edges.map(item => ({
|
knownFor: misc.knownForFeature.edges.map(item => ({
|
||||||
id: item.node.title.id,
|
id: item.node.title.id,
|
||||||
title: item.node.title.titleText.text,
|
title: item.node.title.titleText.text,
|
||||||
...(item.node.title.primaryImage && {
|
...(item.node.title.primaryImage && {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user