private static string GetTitle(GalleryTitleResult titles) { // By default use the Pretty name, if not present then use English // if not then Japanese if (!string.IsNullOrEmpty(titles.Pretty)) { return(titles.Pretty); } return(!string.IsNullOrEmpty(titles.English) ? titles.English : titles.Japanese); }
public static GalleryResult ToGalleryResult(this GalleryResponse response) { return(new() { Id = response.Id, MediaId = response.MediaId, Title = new GalleryTitleResult { Japanese = response.Title.Japanese, English = response.Title.English, Pretty = response.Title.Pretty }, Images = response.Images.Images.ToGalleryImageResult(), Artists = response.Tags.GetTagByGroup("artist"), Parodies = response.Tags.GetTagByGroup("parody"), Characters = response.Tags.GetTagByGroup("character"), Tags = response.Tags.GetTagByGroup("tag"), Categories = response.Tags.GetTagByGroup("category"), Languages = response.Tags.GetTagByGroup("language"), TotalPages = response.TotalPages }); }