feat: manhwa check

This commit is contained in:
2024-07-17 16:38:12 +03:00
parent c9c959ce76
commit 8c87401482
4 changed files with 34 additions and 27 deletions

View File

@@ -84,4 +84,18 @@ export class LibSocialParserService extends Parser {
catchError((error) => throwError(() => `Now found ${error}`)),
);
}
isManhwa(slug_url: string): Observable<boolean> {
return this.http
.get(
`${this.url}/api/manga/${slug_url}?fields[]=summary&fields[]=genres&fields[]=tags&fields[]=authors`,
)
.pipe(
map((data) => {
const res = data as IRulibDetailResult;
return [5, 6, 4].includes(res.data.type.id);
}),
catchError((error) => throwError(() => `Now found ${error}`)),
);
}
}