fixed links on books relations

This commit is contained in:
2026-01-03 20:45:12 +01:00
parent c65a2e1a5b
commit cde09c6ffa
2 changed files with 6 additions and 4 deletions

View File

@@ -202,7 +202,7 @@ function renderRelations(edges) {
const el = document.createElement('div');
el.className = 'relation-card-horizontal';
const img = node.coverImage?.large || node.coverImage?.medium || '/public/assets/no-image.png';
const img = node.coverImage?.large || node.coverImage?.medium || '/public/assets/placeholder.svg';
const title = node.title?.romaji || node.title?.english || node.title?.native || 'Unknown';
const type = edge.relationType ? edge.relationType.replace(/_/g, ' ') : 'Related';
@@ -215,7 +215,8 @@ function renderRelations(edges) {
`;
el.onclick = () => {
const targetType = node.type === 'ANIME' ? 'anime' : 'book';
const imgUrl = node.coverImage?.medium || '';
const targetType = imgUrl.includes('/manga/') ? 'book' : 'anime';
window.location.href = `/${targetType}/${node.id}`;
};