This repository was archived by the owner on Nov 20, 2021. It is now read-only.
File tree 1 file changed +8
-11
lines changed
1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ const BASE = "https://catmanga.org"
15
15
16
16
export const CatMangaInfo : SourceInfo = {
17
17
icon : "icon.png" ,
18
- version : "1.2.9 " ,
18
+ version : "1.2.10 " ,
19
19
name : "CatManga" ,
20
20
author : "PythonCoderAS" ,
21
21
authorWebsite : "https://github.com/PythonCoderAS" ,
@@ -101,18 +101,15 @@ export class CatManga extends Source {
101
101
async searchRequest ( query : SearchRequest , metadata : any ) : Promise < PagedResults > {
102
102
// TODO: Wait for search to be implemented on the website.
103
103
const results = ( await this . getWebsiteMangaDirectory ( null ) ) . results ;
104
+
105
+ let data : MangaTile [ ] ;
104
106
if ( query . title ) {
105
- query . title = query . title . replace ( / \+ / g, " " ) . trim ( ) ;
106
- }
107
- const data : MangaTile [ ] = [ ] ;
108
- for ( let i = 0 ; i < results . length ; i ++ ) {
109
- const key = results [ i ] ;
110
- if ( query . title ) {
111
- if ( ( key . title . text || "" ) . toLowerCase ( ) . includes ( ( query . title . toLowerCase ( ) ) ) ) {
112
- data . push ( key ) ;
113
- }
114
- }
107
+ const filterTitle = query . title . replace ( / \+ / g, " " ) . trim ( ) . toLowerCase ( ) ;
108
+ data = results . filter ( ( key ) => ( key . title . text || "" ) . toLowerCase ( ) . includes ( filterTitle ) )
109
+ } else {
110
+ data = results ;
115
111
}
112
+
116
113
console . log ( data . length )
117
114
return createPagedResults ( {
118
115
results : data
You can’t perform that action at this time.
0 commit comments