File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,9 @@ export class OpenLibraryAPI extends APIModel {
1919
2020 async searchByTitle ( title : string ) : Promise < MediaTypeModel [ ] > {
2121 console . log ( `MDB | api "${ this . apiName } " queried by Title` ) ;
22- const titlesplit = title . split ( "++" )
23- if ( titlesplit . length !== 1 ) {
24- var searchUrl = `https://openlibrary.org/search.json?title=${ encodeURIComponent ( titlesplit [ 0 ] ) } &author=${ encodeURIComponent ( titlesplit [ 1 ] ) } ` ;
25- }
26- else {
27- var searchUrl = `https://openlibrary.org/search.json?title=${ encodeURIComponent ( title ) } ` ;
28- }
22+
23+ const searchUrl = `https://openlibrary.org/search.json?title=${ encodeURIComponent ( title ) } ` ;
24+
2925 const fetchData = await fetch ( searchUrl ) ;
3026 console . debug ( fetchData ) ;
3127 if ( fetchData . status !== 200 ) {
You can’t perform that action at this time.
0 commit comments