protected MangaObject ToMangaObject(MangaDetails details) { if (Equals(details, null)) { return(null); } MangaItem mangaItem = ApiMangaList.Manga.FirstOrDefault(m => Equals(m.Alias, details.Alias)); MangaObject MangaObject = details.ToMangaObject(); MangaObject.Locations = new List <LocationObject> { new LocationObject() { Enabled = true, ExtensionName = ExtensionDescriptionAttribute.Name, ExtensionLanguage = ExtensionDescriptionAttribute.Language, Url = String.Format("https://www.mangaeden.com/api/manga/{0}", mangaItem.Id) } }; foreach (ChapterObject ChapterObject in MangaObject.Chapters) { LocationObject LocObj = ChapterObject.Locations.First(); LocObj.ExtensionName = ExtensionDescriptionAttribute.Name; LocObj.ExtensionLanguage = ExtensionDescriptionAttribute.Language; } return(MangaObject); }
protected SearchResultObject ToSearchResultObject(MangaItem item) { if (Equals(item, null)) { return(null); } SearchResultObject SearchResultObject = item.ToSearchResultObject(); SearchResultObject.ExtensionName = SearchResultObject.Cover.ExtensionName = ExtensionDescriptionAttribute.Name; SearchResultObject.ExtensionLanguage = SearchResultObject.Cover.ExtensionLanguage = ExtensionDescriptionAttribute.Language; return(SearchResultObject); }
public static SearchResultObject ToSearchResultObject(this MangaItem item) { return(new SearchResultObject() { Name = HtmlEntity.DeEntitize(item.Title), Id = item.Id, Url = String.Format("https://www.mangaeden.com/api/manga/{0}", item.Id), Cover = new LocationObject() { Enabled = true, Url = String.Format("https://cdn.mangaeden.com/mangasimg/{0}", item.MangaImageUrl) } }); }