diff --git a/desktop/src/scripts/books/book.js b/desktop/src/scripts/books/book.js index 89d70bf..8b854c9 100644 --- a/desktop/src/scripts/books/book.js +++ b/desktop/src/scripts/books/book.js @@ -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}`; }; diff --git a/docker/src/scripts/books/book.js b/docker/src/scripts/books/book.js index 89d70bf..8b854c9 100644 --- a/docker/src/scripts/books/book.js +++ b/docker/src/scripts/books/book.js @@ -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}`; };