Download Cover and Create Series Info before Chapters.
Create Publication Directory when calling SaveSeriesInfo and DownloadCover
This commit is contained in:
parent
c9602d5f67
commit
bc99735f76
@ -57,7 +57,10 @@ public abstract class Connector
|
|||||||
/// <param name="publication">Publication to save series.json for</param>
|
/// <param name="publication">Publication to save series.json for</param>
|
||||||
public void SaveSeriesInfo(Publication publication)
|
public void SaveSeriesInfo(Publication publication)
|
||||||
{
|
{
|
||||||
string seriesInfoPath = Path.Join(downloadLocation, publication.folderName, "series.json");
|
//Check if Publication already has a Folder and a series.json
|
||||||
|
string publicationFolder = Path.Join(downloadLocation, publication.folderName);
|
||||||
|
Directory.CreateDirectory(publicationFolder);
|
||||||
|
string seriesInfoPath = Path.Join(publicationFolder, "series.json");
|
||||||
if(!File.Exists(seriesInfoPath))
|
if(!File.Exists(seriesInfoPath))
|
||||||
File.WriteAllText(seriesInfoPath,publication.GetSeriesInfo());
|
File.WriteAllText(seriesInfoPath,publication.GetSeriesInfo());
|
||||||
}
|
}
|
||||||
|
@ -67,10 +67,10 @@ public static class TaskExecutor
|
|||||||
private static void DownloadNewChapters(Connector connector, Publication publication, string language, Dictionary<Publication, List<Chapter>> chapterCollection)
|
private static void DownloadNewChapters(Connector connector, Publication publication, string language, Dictionary<Publication, List<Chapter>> chapterCollection)
|
||||||
{
|
{
|
||||||
List<Chapter> newChapters = UpdateChapters(connector, publication, language, chapterCollection);
|
List<Chapter> newChapters = UpdateChapters(connector, publication, language, chapterCollection);
|
||||||
foreach(Chapter newChapter in newChapters)
|
|
||||||
connector.DownloadChapter(publication, newChapter);
|
|
||||||
connector.DownloadCover(publication);
|
connector.DownloadCover(publication);
|
||||||
connector.SaveSeriesInfo(publication);
|
connector.SaveSeriesInfo(publication);
|
||||||
|
foreach(Chapter newChapter in newChapters)
|
||||||
|
connector.DownloadChapter(publication, newChapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user