resolves #17 no cover image
This commit is contained in:
parent
76604d84d8
commit
fcd81f03b3
@ -137,11 +137,11 @@ public abstract class Connector
|
||||
/// <param name="settings">TrangaSettings</param>
|
||||
public void CopyCoverFromCacheToDownloadLocation(Publication publication, TrangaSettings settings)
|
||||
{
|
||||
logger?.WriteLine(this.GetType().ToString(), $"Cloning cover {publication.sortName} {publication.internalId}");
|
||||
logger?.WriteLine(this.GetType().ToString(), $"Cloning cover {publication.sortName} -> {publication.internalId}");
|
||||
//Check if Publication already has a Folder and cover
|
||||
string publicationFolder = publication.CreatePublicationFolder(downloadLocation);
|
||||
DirectoryInfo dirInfo = new (publicationFolder);
|
||||
if (dirInfo.EnumerateFiles().Any(info => info.Name.Contains("cover.")))
|
||||
if (dirInfo.EnumerateFiles().Any(info => info.Name.Contains("cover", StringComparison.InvariantCultureIgnoreCase)))
|
||||
{
|
||||
logger?.WriteLine(this.GetType().ToString(), $"Cover exists {publication.sortName}");
|
||||
return;
|
||||
|
@ -25,6 +25,7 @@ public class DownloadChapterTask : TrangaTask
|
||||
if(this.parentTask is not null)
|
||||
this.parentTask.state = ExecutionState.Running;
|
||||
Connector connector = taskManager.GetConnector(this.connectorName);
|
||||
connector.CopyCoverFromCacheToDownloadLocation(this.publication, taskManager.settings);
|
||||
connector.DownloadChapter(this.publication, this.chapter, this, cancellationToken);
|
||||
if(this.parentTask is not null)
|
||||
this.parentTask.state = ExecutionState.Waiting;
|
||||
|
Loading…
Reference in New Issue
Block a user