Skip to content

Commit

Permalink
#31 fix errors for paths with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
the-database committed Sep 5, 2024
1 parent f9b99b0 commit 7e4609d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions VideoJaNai/Services/PythonService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public string InstallUpdatePythonDependenciesCommand
"onnx",
};

return $@"{PythonPath} -m pip install {string.Join(" ", dependencies)}";
return $@".\python.exe -m pip install {string.Join(" ", dependencies)}";
}
}

Expand All @@ -160,7 +160,7 @@ public string InstallVapourSynthPluginsCommand
"ffms2"
};

return $@"{PythonPath} {VsrepoPath} -p update && {PythonPath} {VsrepoPath} -p install {string.Join(" ", dependencies)}";
return $@".\python.exe .\vsrepo.py -p update && .\python.exe .\vsrepo.py -p install {string.Join(" ", dependencies)}";
}
}

Expand Down
2 changes: 1 addition & 1 deletion VideoJaNai/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ public void CancelUpscale()

public async Task RunUpscaleSingle(string inputFilePath, string outputFilePath)
{
var cmd = $@"{Path.GetRelativePath(_pythonService.BackendDirectory, _pythonService.VspipePath)} -c y4m --arg ""slot=1"" --arg ""video_path={inputFilePath}"" ""{Path.GetFullPath("./backend/animejanai/core/animejanai_encode.vpy")}"" - | {_pythonService.FfmpegPath} {_overwriteCommand} -i pipe: -i ""{inputFilePath}"" -map 0:v -c:v {CurrentWorkflow.FfmpegVideoSettings} -max_interleave_delta 0 -map 1:t? -map 1:a? -map 1:s? -c:t copy -c:a copy -c:s copy ""{outputFilePath}""";
var cmd = $@"{Path.GetRelativePath(_pythonService.BackendDirectory, _pythonService.VspipePath)} -c y4m --arg ""slot=1"" --arg ""video_path={inputFilePath}"" ""{Path.GetFullPath("./backend/animejanai/core/animejanai_encode.vpy")}"" - | ""{_pythonService.FfmpegPath}"" {_overwriteCommand} -i pipe: -i ""{inputFilePath}"" -map 0:v -c:v {CurrentWorkflow.FfmpegVideoSettings} -max_interleave_delta 0 -map 1:t? -map 1:a? -map 1:s? -c:t copy -c:a copy -c:s copy ""{outputFilePath}""";
ConsoleQueueEnqueue($"Upscaling with command: {cmd}");
await RunCommand($@" /C {cmd}");
}
Expand Down

0 comments on commit 7e4609d

Please sign in to comment.