@@ -51,31 +51,31 @@ export class OMDbAPI extends APIModel {
5151 let ret : MediaTypeModel [ ] = [ ] ;
5252
5353 for ( const result of data . Search ) {
54- const type = this . typeMappings . get ( result . type . toLowerCase ( ) ) ;
54+ const type = this . typeMappings . get ( result . Type . toLowerCase ( ) ) ;
5555 if ( type === undefined ) {
5656 continue ;
5757 }
58- if ( result . Type === 'movie' ) {
58+ if ( type === 'movie' ) {
5959 ret . push ( new MovieModel ( {
60- type : 'movie' ,
60+ type : type ,
6161 title : result . Title ,
6262 englishTitle : result . Title ,
6363 year : result . Year ,
6464 dataSource : this . apiName ,
6565 id : result . imdbID ,
6666 } as MovieModel ) ) ;
67- } else if ( result . Type === 'series' ) {
67+ } else if ( type === 'series' ) {
6868 ret . push ( new SeriesModel ( {
69- type : 'series' ,
69+ type : type ,
7070 title : result . Title ,
7171 englishTitle : result . Title ,
7272 year : result . Year ,
7373 dataSource : this . apiName ,
7474 id : result . imdbID ,
7575 } as SeriesModel ) ) ;
76- } else if ( result . Type === 'game' ) {
76+ } else if ( type === 'game' ) {
7777 ret . push ( new GameModel ( {
78- type : 'game' ,
78+ type : type ,
7979 title : result . Title ,
8080 englishTitle : result . Title ,
8181 year : result . Year ,
@@ -108,7 +108,7 @@ export class OMDbAPI extends APIModel {
108108 throw Error ( `Received error from ${ this . apiName } : ${ result . Error } ` ) ;
109109 }
110110
111- const type = this . typeMappings . get ( result . type . toLowerCase ( ) ) ;
111+ const type = this . typeMappings . get ( result . Type . toLowerCase ( ) ) ;
112112 if ( type === undefined ) {
113113 throw Error ( `${ result . type . toLowerCase ( ) } is an unsupported type.` ) ;
114114 }
0 commit comments