@@ -131,6 +131,7 @@ public function main()
131131 }
132132 titleType {
133133 text
134+ canHaveEpisodes
134135 }
135136 releaseYear {
136137 year
@@ -146,6 +147,17 @@ public function main()
146147 }
147148 ratingsSummary {
148149 aggregateRating
150+ voteCount
151+ }
152+ spokenLanguages {
153+ spokenLanguages {
154+ text
155+ }
156+ }
157+ countriesOfOrigin {
158+ countries {
159+ text
160+ }
149161 }
150162 titleGenres {
151163 genres {
@@ -195,6 +207,8 @@ public function main()
195207 'reDirectId ' => $ this ->checkRedirect ($ data ),
196208 'movieType ' => isset ($ data ->title ->titleType ->text ) ?
197209 $ data ->title ->titleType ->text : null ,
210+ 'hasEpisode ' => isset ($ data ->title ->titleType ->canHaveEpisodes ) ?
211+ $ data ->title ->titleType ->canHaveEpisodes : false ,
198212 'year ' => isset ($ data ->title ->releaseYear ->year ) ?
199213 $ data ->title ->releaseYear ->year : null ,
200214 'endYear ' => isset ($ data ->title ->releaseYear ->endYear ) ?
@@ -205,11 +219,29 @@ public function main()
205219 $ data ->title ->runtime ->seconds / 60 : 0 ,
206220 'rating ' => isset ($ data ->title ->ratingsSummary ->aggregateRating ) ?
207221 $ data ->title ->ratingsSummary ->aggregateRating : 0 ,
222+ 'votes ' => isset ($ data ->title ->ratingsSummary ->voteCount ) ?
223+ $ data ->title ->ratingsSummary ->voteCount : 0 ,
224+ 'language ' => [],
225+ 'country ' => [],
208226 'genre ' => $ this ->genre ($ data ),
209227 'plotoutline ' => isset ($ data ->title ->plot ->plotText ->plainText ) ?
210228 $ data ->title ->plot ->plotText ->plainText : null ,
211229 'credits ' => $ this ->principalCredits ($ data )
212230 );
231+ if (!empty ($ data ->title ->spokenLanguages ->spokenLanguages )) {
232+ foreach ($ data ->title ->spokenLanguages ->spokenLanguages as $ language ) {
233+ if (!empty ($ language ->text )) {
234+ $ this ->main ['language ' ][] = $ language ->text ;
235+ }
236+ }
237+ }
238+ if (!empty ($ data ->title ->countriesOfOrigin ->countries )) {
239+ foreach ($ data ->title ->countriesOfOrigin ->countries as $ country ) {
240+ if (!empty ($ country ->text )) {
241+ $ this ->main ['country ' ][] = $ country ->text ;
242+ }
243+ }
244+ }
213245 return $ this ->main ;
214246 }
215247
0 commit comments