Created Method to check wether file is already downloaded.

Using this method when running TaskExecutor.UpdateChapters to get a list of all chapters that have not yet been downloaded.
This commit is contained in:
2023-05-20 01:30:23 +02:00
parent 08e0fe7c71
commit 9d583b284a
3 changed files with 12 additions and 4 deletions

View File

@ -77,6 +77,16 @@ public abstract class Connector
);
return comicInfo.ToString();
}
public bool ChapterIsDownloaded(Publication publication, Chapter chapter)
{
return File.Exists(CreateFullFilepath(publication, chapter));
}
protected string CreateFullFilepath(Publication publication, Chapter chapter)
{
return Path.Join(downloadLocation, publication.folderName, chapter.fileName);
}
/// <summary>
/// Downloads Image from URL and saves it to the given path(incl. fileName)