feat: find-novel search across all sources; fix WeTriedTLS apostrophe search
Publish Plugins / Publish Plugins (push) Has been cancelled
Publish Plugins / Publish Plugins (push) Has been cancelled
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,7 +42,7 @@ class WeTriedTLS implements Plugin.PluginBase {
|
||||
name = 'WeTriedTLS';
|
||||
icon = 'src/en/wetriedtls/icon.png';
|
||||
site = 'https://wetriedtls.com';
|
||||
version = '1.0.0';
|
||||
version = '1.0.1';
|
||||
|
||||
async api<T>(path: string): Promise<T> {
|
||||
const res = await fetchApi(API + path, { headers: { Referer: this.site } });
|
||||
@@ -72,7 +72,16 @@ class WeTriedTLS implements Plugin.PluginBase {
|
||||
}
|
||||
|
||||
searchNovels(searchTerm: string, pageNo: number) {
|
||||
return this.query(`query_string=${encodeURIComponent(searchTerm)}`, pageNo);
|
||||
// The API matches literally and titles use curly apostrophes, so search
|
||||
// with the longest apostrophe-free run of words.
|
||||
const query = searchTerm
|
||||
.split(/\S*['’]\S*/)
|
||||
.map(part => part.trim())
|
||||
.reduce((a, b) => (b.length > a.length ? b : a), '');
|
||||
return this.query(
|
||||
`query_string=${encodeURIComponent(query || searchTerm)}`,
|
||||
pageNo,
|
||||
);
|
||||
}
|
||||
|
||||
async parseNovel(novelPath: string): Promise<Plugin.SourceNovel> {
|
||||
|
||||
Reference in New Issue
Block a user