예제 #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;
            }
        }
예제 #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);
            }
        }