feat: find-novel search across all sources; fix WeTriedTLS apostrophe search
Publish Plugins / Publish Plugins (push) Has been cancelled

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
masi
2026-09-25 12:31:47 -03:00
parent a504a48e6e
commit 053aa91b02
3 changed files with 135 additions and 3 deletions
+11 -2
View File
@@ -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> {