示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 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)
         }
     });
 }