fix(library): exclude light novels from anilist manga resolve
This commit is contained in:
parent
8a046a0ea2
commit
3eb89772c7
2 changed files with 14 additions and 1 deletions
|
|
@ -33,7 +33,7 @@ const ANILIST_MEDIA_FIELDS = `
|
|||
|
||||
const ANILIST_SEARCH_QUERY = `query ($q: String) {
|
||||
Page(perPage: 8) {
|
||||
media(search: $q, type: MANGA) {
|
||||
media(search: $q, type: MANGA, format_not_in: [NOVEL]) {
|
||||
${ANILIST_MEDIA_FIELDS}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -920,6 +920,19 @@ describe('mangaSpec.resolve — AniList primary', () => {
|
|||
expect(result).toEqual({ mal_id: '116778', anilist_id: '105778' });
|
||||
expect(mangadexCalled).toBe(false);
|
||||
});
|
||||
|
||||
test('search query includes format_not_in: [NOVEL] to exclude light novels', async () => {
|
||||
let capturedQuery = '';
|
||||
const deps = makeDeps({
|
||||
http: async () => ({ data: [] }),
|
||||
httpPostJson: async (url: string, body: any) => {
|
||||
capturedQuery = body.query;
|
||||
return anilistPage([{ id: 105778, idMal: 116778, title: { romaji: 'Overlord', english: 'Overlord' } }]);
|
||||
},
|
||||
});
|
||||
await mangaSpec.resolve(ctxFor({ title: 'Overlord' }, ''), deps);
|
||||
expect(capturedQuery).toContain('format_not_in: [NOVEL]');
|
||||
});
|
||||
});
|
||||
|
||||
describe('mangaSpec.sync — AniList primary enrich', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue