This repository was archived by the owner on Nov 20, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 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"
1515
1616export const CatMangaInfo : SourceInfo = {
1717 icon : "icon.png" ,
18- version : "1.2.9 " ,
18+ version : "1.2.10 " ,
1919 name : "CatManga" ,
2020 author : "PythonCoderAS" ,
2121 authorWebsite : "https://github.com/PythonCoderAS" ,
@@ -101,18 +101,15 @@ export class CatManga extends Source {
101101 async searchRequest ( query : SearchRequest , metadata : any ) : Promise < PagedResults > {
102102 // TODO: Wait for search to be implemented on the website.
103103 const results = ( await this . getWebsiteMangaDirectory ( null ) ) . results ;
104+
105+ let data : MangaTile [ ] ;
104106 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 ;
115111 }
112+
116113 console . log ( data . length )
117114 return createPagedResults ( {
118115 results : data
You can’t perform that action at this time.
0 commit comments