Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit a93da58

Browse files
committed
fix: pass include anilist manga to search
1 parent 4414322 commit a93da58

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/server/trpc/router/manga.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ export const mangaRouter = t.router({
175175
mangaDetail.metadata.cover?.large ||
176176
mangaDetail.metadata.cover?.medium,
177177
authors: mangaDetail.metadata.staff?.story ? [...mangaDetail.metadata.staff.story] : [],
178-
characters: mangaDetail.metadata.characters,
179-
genres: mangaDetail.metadata.genres,
178+
characters: mangaDetail.metadata.characters ? [...mangaDetail.metadata.characters] : [],
179+
genres: mangaDetail.metadata.genres ? [...mangaDetail.metadata.genres] : [],
180180
startDate: mangaDetail.metadata.startDate
181181
? new Date(
182182
mangaDetail.metadata.startDate.year,
@@ -193,9 +193,9 @@ export const mangaRouter = t.router({
193193
: undefined,
194194
status: mangaDetail.metadata.status,
195195
summary: mangaDetail.metadata.summary,
196-
synonyms: mangaDetail.metadata.synonyms,
197-
tags: mangaDetail.metadata.tags,
198-
urls: mangaDetail.metadata.urls,
196+
synonyms: mangaDetail.metadata.synonyms ? [...mangaDetail.metadata.synonyms] : [],
197+
tags: mangaDetail.metadata.tags ? [...mangaDetail.metadata.tags] : [],
198+
urls: mangaDetail.metadata.urls ? [...mangaDetail.metadata.urls] : [],
199199
},
200200
},
201201
},

src/server/utils/mangal.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,15 @@ export const updateExistingMangaMetadata = async (libraryPath: string, title: st
167167

168168
export const search = async (source: string, keyword: string): Promise<IOutput> => {
169169
try {
170-
const { stdout, command } = await execa('mangal', ['inline', '--source', source, '--query', keyword, '-j']);
170+
const { stdout, command } = await execa('mangal', [
171+
'inline',
172+
'--source',
173+
source,
174+
'--include-anilist-manga',
175+
'--query',
176+
keyword,
177+
'-j',
178+
]);
171179
logger.info(`Search manga with following command: ${command}`);
172180
return JSON.parse(stdout);
173181
} catch (err) {
@@ -216,6 +224,7 @@ export const getMangaDetail = async (source: string, title: string): Promise<Man
216224
'inline',
217225
'--source',
218226
source,
227+
'--include-anilist-manga',
219228
'--query',
220229
title,
221230
'--manga',

0 commit comments

Comments
 (0)