Example #1
0
        public async Task CheckUpdateAsync()
        {
            this.Status = BookmarkInfoStatus.ChapterDownloading;
            var narou = new NarouClient();

            try
            {
                var count = await narou.GetChapterCountAsync(this.Ncode);

                if (count == this.Chapters.Count)
                {
                    return;
                }

                var startIndex  = this.Chapters.Count + 1;
                var updateCount = count - this.Chapters.Count;
                var newChapters = new List <NarouChapter>();
                for (int i = 0; i < updateCount; i++)
                {
                    var index   = i + startIndex;
                    var chapter = new NarouChapter(this.Ncode, index);
                    newChapters.Add(chapter);
                    this.Add(chapter);
                }

                //await Task.WhenAll(newChapters.Select(x => x.DownloadTitleAsync()));
            }
            finally
            {
                this.Status = BookmarkInfoStatus.ChapterLoaded;
            }
        }
Example #2
0
        protected override async Task DoChapterDownloading()
        {
            var narou = new NarouClient();
            var count = await narou.GetChapterCountAsync(this.Ncode);

            for (int i = 0; i < count; i++)
            {
                var chapter = new NarouChapter(this.Ncode, i + 1);
                this.Add(chapter);
            }
        }
Example #3
0
        protected override async Task DoDownloadingAsync(string ncode)
        {
            var narou = new NarouClient();

            if (!await narou.ExistNcodeAsync(ncode))
            {
                return;
            }

            var bookmarkInfo = new NarouBookmarkInfo(ncode);

            this.Add(bookmarkInfo);
        }
Example #4
0
        protected override async Task DoSummaryDownloading()
        {
            var narou = new NarouClient();

            (this.Title, this.Writer) = await narou.GetSummaryAsync(this.Ncode);
        }
Example #5
0
        protected override async Task DoContentDownloading()
        {
            var narou = new NarouClient();

            this.Content = await narou.GetChapterContentAsync(this.Ncode, this.Index);
        }
Example #6
0
        protected override async Task DoTitleDownloading()
        {
            var narou = new NarouClient();

            this.Title = await narou.GetChapterTitleAsync(this.Ncode, this.Index);
        }