/// <summary> /// Convert a <see cref="MovieCast"/> to a <see cref="Abstractions.Models.PeopleRole"/>. /// </summary> /// <param name="cast">An internal TheMovieDB cast.</param> /// <param name="provider">The provider that represent TheMovieDB inside Kyoo.</param> /// <returns>A <see cref="Abstractions.Models.PeopleRole"/> representing the movie cast.</returns> public static PeopleRole ToPeople(this MovieCast cast, Provider provider) { return(new PeopleRole { People = new People { Slug = Utility.ToSlug(cast.Name), Name = cast.Name, Images = new Dictionary <int, string> { [Images.Poster] = cast.ProfilePath != null ? $"https://image.tmdb.org/t/p/original{cast.ProfilePath}" : null }, ExternalIDs = new[] { new MetadataID { Provider = provider, DataID = cast.Id.ToString(), Link = $"https://www.themoviedb.org/person/{cast.Id}" } } }, Type = "Actor", Role = cast.Character }); }
public MediaCredit(TMDbLib.Objects.Movies.Cast cast) { Id = cast.Id; CreditId = cast.CreditId; Name = cast.Name; Profile = ModelUtils.GetSmallImageUri(cast.ProfilePath); Department = string.Empty; Job = string.Empty; Character = cast.Character; }