Skip to content

Commit

Permalink
Merge branch 'main' into feat/#23
Browse files Browse the repository at this point in the history
  • Loading branch information
TakenPt committed Apr 20, 2024
2 parents 456ff7d + de81a0a commit 990c31e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions KoeBook/Services/CoreMocks/AnalyzerServiceMock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class AnalyzerServiceMock(IDisplayStateChangeService stateService) : IAna

public async ValueTask<BookScripts> AnalyzeAsync(BookProperties bookProperties, string tempDirectory, CancellationToken cancellationToken)
{
Directory.CreateDirectory(tempDirectory);
DisplayStateChanging stateChanging;
if (bookProperties.SourceType == SourceType.Url)
{
Expand Down
8 changes: 6 additions & 2 deletions KoeBook/Services/GenerationTaskRunnerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ private async ValueTask RunAsync(GenerationTask task)
return;

await RunAsyncCore(task, true);
await RunAsyncCore(task, false);
if (task.SkipEdit)
await RunAsyncCore(task, false);
}

public async void RunGenerateEpubAsync(GenerationTask task)
Expand Down Expand Up @@ -83,7 +84,10 @@ private async ValueTask RunAsyncCore(GenerationTask task, bool firstStep)
task.Progress = 1;
task.MaximumProgress = 1;
var fileName = Path.GetFileName(resultPath);
File.Move(resultPath, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "KoeBook", fileName), true);
var resultDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "KoeBook");
if (!Directory.Exists(resultDirectory))
Directory.CreateDirectory(resultDirectory);
File.Move(resultPath, Path.Combine(resultDirectory, fileName), true);
}
else
throw new InvalidOperationException();
Expand Down

0 comments on commit 990c31e

Please sign in to comment.