Compare commits
No commits in common. "b7014cbff585de38da4af3a038bc0a1c5d167b28" and "0cab9214029275b5732416bb237e5ecddc9295df" have entirely different histories.
b7014cbff5
...
0cab921402
@ -106,7 +106,7 @@ public abstract class Connector
|
||||
/// <returns>Filepath</returns>
|
||||
protected string CreateFullFilepath(Publication publication, Chapter chapter)
|
||||
{
|
||||
return Path.Join(downloadLocation, publication.folderName, $"{chapter.fileName}.cbz");
|
||||
return Path.Join(downloadLocation, publication.folderName, chapter.fileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -134,11 +134,13 @@ public abstract class Connector
|
||||
{
|
||||
logger?.WriteLine("Connector", "Downloading Images");
|
||||
//Check if Publication Directory already exists
|
||||
string directoryPath = Path.GetDirectoryName(saveArchiveFilePath)!;
|
||||
string[] splitPath = saveArchiveFilePath.Split(Path.DirectorySeparatorChar);
|
||||
string directoryPath = Path.Combine(splitPath.Take(splitPath.Length - 1).ToArray());
|
||||
if (!Directory.Exists(directoryPath))
|
||||
Directory.CreateDirectory(directoryPath);
|
||||
|
||||
if (File.Exists(saveArchiveFilePath)) //Don't download twice.
|
||||
|
||||
string fullPath = $"{saveArchiveFilePath}.cbz";
|
||||
if (File.Exists(fullPath)) //Don't download twice.
|
||||
return;
|
||||
|
||||
//Create a temporary folder to store images
|
||||
@ -158,7 +160,7 @@ public abstract class Connector
|
||||
|
||||
logger?.WriteLine("Connector", "Creating archive");
|
||||
//ZIP-it and ship-it
|
||||
ZipFile.CreateFromDirectory(tempFolder, saveArchiveFilePath);
|
||||
ZipFile.CreateFromDirectory(tempFolder, fullPath);
|
||||
Directory.Delete(tempFolder, true); //Cleanup
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user