feat(ui): complete Avalonia UI port with 7 main pages, tool settings & top MenuBar
This commit is contained in:
@@ -776,12 +776,10 @@ public sealed class SocialMediaManagerTool : IAgentTool, IToolJobProvider
|
||||
if (detectedPath == null)
|
||||
{
|
||||
// 2. Check local paths
|
||||
var baseDir = AppDomain.CurrentDomain.BaseDirectory;
|
||||
string[] candidates =
|
||||
[
|
||||
Path.Combine(baseDir, "yt-dlp.exe"),
|
||||
Path.Combine(baseDir, "tools", "yt-dlp.exe")
|
||||
];
|
||||
// Unter Linux heißt das Programm ohne Endung. Ohne diese Variante fände die
|
||||
// Suche im Programmverzeichnis dort nie etwas — und die PATH-Prüfung davor
|
||||
// ist die einzige, die griffe.
|
||||
var candidates = LocalToolCandidates("yt-dlp");
|
||||
|
||||
foreach (var p in candidates)
|
||||
{
|
||||
@@ -819,12 +817,7 @@ public sealed class SocialMediaManagerTool : IAgentTool, IToolJobProvider
|
||||
if (!hasFfmpeg)
|
||||
{
|
||||
// Check local paths for ffmpeg
|
||||
var baseDir = AppDomain.CurrentDomain.BaseDirectory;
|
||||
string[] ffmpegCandidates =
|
||||
[
|
||||
Path.Combine(baseDir, "ffmpeg.exe"),
|
||||
Path.Combine(baseDir, "tools", "ffmpeg.exe")
|
||||
];
|
||||
var ffmpegCandidates = LocalToolCandidates("ffmpeg");
|
||||
|
||||
foreach (var fp in ffmpegCandidates)
|
||||
{
|
||||
@@ -840,6 +833,29 @@ public sealed class SocialMediaManagerTool : IAgentTool, IToolJobProvider
|
||||
return (true, detectedPath, hasFfmpeg, ffmpegPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wo ein mitgeliefertes Hilfsprogramm liegen könnte — Programmverzeichnis und
|
||||
/// <c>tools/</c>, je mit und ohne <c>.exe</c>.
|
||||
///
|
||||
/// Die Endung wird auf beiden Plattformen mitgeprüft, nicht nur auf der jeweils
|
||||
/// „richtigen": Ein Deployment-Paket, das unter Windows geschnürt wurde, kann die
|
||||
/// Windows-Binärdatei enthalten, und umgekehrt. Vier Aufrufe von
|
||||
/// <see cref="File.Exists"/> sind billiger als eine Fallunterscheidung, die man
|
||||
/// vergessen kann.
|
||||
/// </summary>
|
||||
private static string[] LocalToolCandidates(string name)
|
||||
{
|
||||
var baseDir = AppContext.BaseDirectory;
|
||||
|
||||
return
|
||||
[
|
||||
Path.Combine(baseDir, name),
|
||||
Path.Combine(baseDir, name + ".exe"),
|
||||
Path.Combine(baseDir, "tools", name),
|
||||
Path.Combine(baseDir, "tools", name + ".exe")
|
||||
];
|
||||
}
|
||||
|
||||
private string GetYtDlpInstallationGuide()
|
||||
{
|
||||
return "FEHLER: Abhängigkeiten fehlen für YouTube-Funktionen.\n\n" +
|
||||
|
||||
Reference in New Issue
Block a user