public static Hub Clone(this Hub o) { Hub h = new Hub(); h.HubIdentifier = o.HubIdentifier; h.Key = PlexHelper.ReplaceSchemeHost(o.Key); h.More = o.More; h.Size = o.Size; h.Title = o.Title; h.Type = o.Type; return(h); }
public static Video Clone(this Video o) { Video v; if (o is Directory) { v = new Directory(); } else { v = new Video(); } v.AddedAt = o.AddedAt; v.AirDate = o.AirDate; v.Art = PlexHelper.ReplaceSchemeHost(o.Art); v.ParentArt = PlexHelper.ReplaceSchemeHost(o.ParentArt); v.GrandparentArt = PlexHelper.ReplaceSchemeHost(o.GrandparentArt); v.ChapterSource = o.ChapterSource; v.ContentRating = o.ContentRating; v.Duration = o.Duration; v.EpNumber = o.EpNumber; v.EpisodeCount = o.EpisodeCount; v.ExtraType = o.ExtraType; if (o.Extras != null) { v.Extras = new Extras(); v.Extras.Size = o.Extras.Size; if (o.Extras.Videos != null) { v.Extras.Videos = new List <Video>(); o.Extras.Videos.ForEach(a => v.Extras.Videos.Add(a.Clone())); } } v.Genres = o.Genres; v.GrandparentKey = o.GrandparentKey; v.GrandparentRatingKey = o.GrandparentRatingKey; v.GrandparentTitle = o.GrandparentTitle; v.Group = o.Group; v.Guid = o.Guid; v.Index = o.Index; v.Key = PlexHelper.ReplaceSchemeHost(o.Key); v.LeafCount = o.LeafCount; v.Medias = o.Medias; v.OriginalTitle = o.OriginalTitle; v.OriginallyAvailableAt = o.OriginallyAvailableAt; v.ParentIndex = o.ParentIndex; v.ParentKey = o.ParentKey; v.ParentRatingKey = o.ParentRatingKey; v.ParentTitle = o.ParentTitle; v.PrimaryExtraKey = o.PrimaryExtraKey; v.Rating = o.Rating; v.RatingKey = o.RatingKey; if (o.Related != null) { v.Related = new List <Hub>(); o.Related.ForEach(a => v.Related.Add(a.Clone())); } v.Roles = o.Roles; v.Season = o.Season; v.SourceTitle = o.SourceTitle; v.Summary = o.Summary; v.Tagline = o.Tagline; v.Tags = o.Tags; v.Thumb = PlexHelper.ReplaceSchemeHost(o.Thumb); v.ParentThumb = PlexHelper.ReplaceSchemeHost(o.ParentThumb); v.GrandparentThumb = PlexHelper.ReplaceSchemeHost(o.GrandparentThumb); v.Title = o.Title; v.Type = o.Type; v.UpdatedAt = o.UpdatedAt; v.Url = PlexHelper.ReplaceSchemeHost(o.Url); v.ViewCount = o.ViewCount; v.ViewOffset = o.ViewOffset; v.ViewedLeafCount = o.ViewedLeafCount; v.Year = o.Year; return(v); }