@@ -208,13 +208,17 @@ private async Task<MetadataResult<Series>> FetchMovieData(string tmdbId, string
208
208
result . Item = new Series ( ) ;
209
209
result . ResultLanguage = seriesInfo . ResultLanguage ;
210
210
211
- ProcessMainInfo ( result . Item , seriesInfo , preferredCountryCode ) ;
211
+ var settings = await MovieDbProvider . Current . GetTmdbSettings ( cancellationToken ) . ConfigureAwait ( false ) ;
212
+
213
+ ProcessMainInfo ( result , seriesInfo , preferredCountryCode , settings ) ;
212
214
213
215
return result ;
214
216
}
215
217
216
- private void ProcessMainInfo ( Series series , RootObject seriesInfo , string preferredCountryCode )
218
+ private void ProcessMainInfo ( MetadataResult < Series > seriesResult , RootObject seriesInfo , string preferredCountryCode , TmdbSettingsResult settings )
217
219
{
220
+ var series = seriesResult . Item ;
221
+
218
222
series . Name = seriesInfo . name ;
219
223
series . SetProviderId ( MetadataProviders . Tmdb , seriesInfo . id . ToString ( _usCulture ) ) ;
220
224
@@ -307,6 +311,35 @@ private void ProcessMainInfo(Series series, RootObject seriesInfo, string prefer
307
311
}
308
312
}
309
313
}
314
+
315
+ seriesResult . ResetPeople ( ) ;
316
+ var tmdbImageUrl = settings . images . GetImageUrl ( "original" ) ;
317
+
318
+ if ( seriesInfo . credits != null && seriesInfo . credits . cast != null )
319
+ {
320
+ foreach ( var actor in seriesInfo . credits . cast . OrderBy ( a => a . order ) )
321
+ {
322
+ var personInfo = new PersonInfo
323
+ {
324
+ Name = actor . name . Trim ( ) ,
325
+ Role = actor . character ,
326
+ Type = PersonType . Actor ,
327
+ SortOrder = actor . order
328
+ } ;
329
+
330
+ if ( ! string . IsNullOrWhiteSpace ( actor . profile_path ) )
331
+ {
332
+ personInfo . ImageUrl = tmdbImageUrl + actor . profile_path ;
333
+ }
334
+
335
+ if ( actor . id > 0 )
336
+ {
337
+ personInfo . SetProviderId ( MetadataProviders . Tmdb , actor . id . ToString ( CultureInfo . InvariantCulture ) ) ;
338
+ }
339
+
340
+ seriesResult . AddPerson ( personInfo ) ;
341
+ }
342
+ }
310
343
}
311
344
312
345
internal static string GetSeriesDataPath ( IApplicationPaths appPaths , string tmdbId )
0 commit comments