Snarky comments. Documentation

This commit is contained in:
2023-05-20 15:05:41 +02:00
parent 430ee2301f
commit 4ee47ed65c
6 changed files with 71 additions and 13 deletions

View File

@ -68,6 +68,11 @@ public abstract class Connector
File.WriteAllText(seriesInfoPath,publication.GetSeriesInfoJson());
}
/// <summary>
/// Creates a string containing XML of publication and chapter.
/// See ComicInfo.xml
/// </summary>
/// <returns>XML-string</returns>
protected static string CreateComicInfo(Publication publication, Chapter chapter)
{
XElement comicInfo = new XElement("ComicInfo",
@ -80,11 +85,19 @@ public abstract class Connector
return comicInfo.ToString();
}
/// <summary>
/// Checks if a chapter-archive is already present
/// </summary>
/// <returns>true if chapter is present</returns>
public bool ChapterIsDownloaded(Publication publication, Chapter chapter)
{
return File.Exists(CreateFullFilepath(publication, chapter));
}
/// <summary>
/// Creates full file path of chapter-archive
/// </summary>
/// <returns>Filepath</returns>
protected string CreateFullFilepath(Publication publication, Chapter chapter)
{
return Path.Join(downloadLocation, publication.folderName, chapter.fileName);