feat: manhwa check
This commit is contained in:
@@ -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}`)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +59,8 @@ export class SearchService {
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
isManhwa(url: string): Observable<boolean> {
|
||||
return this.parser.isManhwa(url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user