예제 #1
0
        public void Download()
        {
            Chapter = SerieTestData.Serie.Chapters.ElementAtOrDefault(Index - 1);

            PageCount = -1;

            URL = Chapter.URL;

            Chapter.State = ChapterState.Waiting;
            Limiter.BeginChapter(Chapter);
            try
            {
                Chapter.DownloadPagesList();
            }
            finally
            {
                Limiter.EndChapter(Chapter);
            }

            PageCount = Chapter.Pages.Count;
            Title     = Chapter.Title;

            foreach (var page in Pages)
            {
                if (page.Index > PageCount)
                {
                    page.Index = -1;
                    page.Name += " - index out of range";
                    continue;
                }

                page.Download();
            }
        }