Check if directory exists before creating
This commit is contained in:
parent
1b59475254
commit
26ef59ab42
@ -59,7 +59,9 @@ public abstract class Connector
|
||||
{
|
||||
//Check if Publication already has a Folder and a series.json
|
||||
string publicationFolder = Path.Join(downloadLocation, publication.folderName);
|
||||
Directory.CreateDirectory(publicationFolder);
|
||||
if(!Directory.Exists(publicationFolder))
|
||||
Directory.CreateDirectory(publicationFolder);
|
||||
|
||||
string seriesInfoPath = Path.Join(publicationFolder, "series.json");
|
||||
if(!File.Exists(seriesInfoPath))
|
||||
File.WriteAllText(seriesInfoPath,publication.GetSeriesInfo());
|
||||
|
@ -205,7 +205,8 @@ public class MangaDex : Connector
|
||||
{
|
||||
//Check if Publication already has a Folder and cover
|
||||
string publicationFolder = Path.Join(downloadLocation, publication.folderName);
|
||||
Directory.CreateDirectory(publicationFolder);
|
||||
if(!Directory.Exists(publicationFolder))
|
||||
Directory.CreateDirectory(publicationFolder);
|
||||
DirectoryInfo dirInfo = new (publicationFolder);
|
||||
foreach(FileInfo fileInfo in dirInfo.EnumerateFiles())
|
||||
if (fileInfo.Name.Contains("cover."))
|
||||
|
Loading…
Reference in New Issue
Block a user