Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
        protected override async Task DoChapterLoading()
        {
            var deserializer = new BookmarkInfoDeserializer(this.Ncode);
            var chapters     = await deserializer.GetChapterCountAsync();

            for (int i = 0; i < chapters; i++)
            {
                var c = new NarouChapter(this.Ncode, i + 1);
                this.Add(c);
            }
        }