renamed variable
This commit is contained in:
parent
cd061d23fc
commit
f92bcebe04
@ -17,7 +17,7 @@ public abstract class Connector
|
|||||||
public abstract void DownloadChapter(Publication publication, Chapter chapter); //where to?
|
public abstract void DownloadChapter(Publication publication, Chapter chapter); //where to?
|
||||||
protected abstract void DownloadImage(string url, string savePath);
|
protected abstract void DownloadImage(string url, string savePath);
|
||||||
|
|
||||||
internal void DownloadChapter(string[] imageUrls, string outputFilePath)
|
internal void DownloadChapter(string[] imageUrls, string saveArchiveFilePath)
|
||||||
{
|
{
|
||||||
string tempFolder = Path.GetTempFileName();
|
string tempFolder = Path.GetTempFileName();
|
||||||
File.Delete(tempFolder);
|
File.Delete(tempFolder);
|
||||||
@ -31,12 +31,12 @@ public abstract class Connector
|
|||||||
DownloadImage(imageUrl, Path.Join(tempFolder, $"{chapter++}.{extension}"));
|
DownloadImage(imageUrl, Path.Join(tempFolder, $"{chapter++}.{extension}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
string[] splitPath = outputFilePath.Split(Path.DirectorySeparatorChar);
|
string[] splitPath = saveArchiveFilePath.Split(Path.DirectorySeparatorChar);
|
||||||
string directoryPath = Path.Combine(splitPath.Take(splitPath.Length - 1).ToArray());
|
string directoryPath = Path.Combine(splitPath.Take(splitPath.Length - 1).ToArray());
|
||||||
if (!Directory.Exists(directoryPath))
|
if (!Directory.Exists(directoryPath))
|
||||||
Directory.CreateDirectory(directoryPath);
|
Directory.CreateDirectory(directoryPath);
|
||||||
|
|
||||||
string fullPath = $"{outputFilePath}.cbz";
|
string fullPath = $"{saveArchiveFilePath}.cbz";
|
||||||
File.Delete(fullPath);
|
File.Delete(fullPath);
|
||||||
ZipFile.CreateFromDirectory(tempFolder, fullPath);
|
ZipFile.CreateFromDirectory(tempFolder, fullPath);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user