Example #1
0
        public static async Task <int> NovelViewData(this SFClient _, int NovelID)
        {
            var result = await HttpClientFactory.AppApiService().GetUserViewDataResponse();

            foreach (var item in result.data)
            {
                if (item.novelId == NovelID)
                {
                    return(item.chapterId);
                }
            }
            return(-1);
        }
Example #2
0
        public static async Task <List <Volumelist> > GetBookDir(this SFClient _, int NovelID)
        {
            var result = await HttpClientFactory.AppApiService().GetNovelDirResponse(NovelID.ToString());

            var list = new List <Volumelist>();

            if (result is { } res)
            {
                list.AddRange(res.data.volumeList.Select(p => new Volumelist {
                    Chapterlist = p.chapterList.ToChapterItem(),
                    Sno         = p.sno,
                    Title       = p.title,
                    VolumeId    = p.volumeId
                }));
            }
            return(list);
        }
Example #3
0
        public static async Task <BookInfo> GetBookInfo(this SFClient _, string NovelID)
        {
            var result = await HttpClientFactory.AppApiService().GetNovelInfoResponse(NovelID);

            return(new BookInfo()
            {
                AuthorName = result.data.authorName,
                ImgUrl = result.data.novelCover,
                AuthorUrl = await GetAuthorAvatar(_, result.data.authorId),
                Intro = result.data.expand.intro,
                IsNeedVIP = result.data.signStatus.ToLower().IndexOf("vip") >= 0,
                LatestString = result.data.expand.latestChapter.addTime.ToString() + "    " + result.data.expand.latestChapter.title,
                MarkCount = result.data.markCount.ToString(),
                Point = (int)(result.data.point / 2),
                TicketCount = result.data.expand.ticket.ToString(),
                Title = result.data.novelName,
                TypeString = result.data.expand.typeName + "/" + ((!result.data.isFinish) ? "连载中" : "已完结"),
                Like = result.data.expand.fav
            });
        }