implemented search artists in MusicBrainz

This commit is contained in:
2026-08-17 01:10:30 +02:00
parent b02feb0b9f
commit 2d12ec2818
11 changed files with 419 additions and 30 deletions
+43
View File
@@ -0,0 +1,43 @@
using System;
using System.IO;
namespace HarmonyWinUI.Models
{
class YTDLP
{
private String binPath = string.Empty;
public YTDLP()
{
this.binPath = this.findBinnary();
System.Diagnostics.Debug.WriteLine("binPath = " + this.binPath);
if (this.binPath.Equals(string.Empty))
{
throw new Exception("Binnary for YT-DLP not found.");
}
}
private String findBinnary()
{
DirectoryInfo? currentDirectory = new DirectoryInfo(AppContext.BaseDirectory);
while (currentDirectory != null)
{
string candidatePath = Path.Combine(
currentDirectory.FullName,
"vendor",
"yt-dlp.exe"
);
if (File.Exists(candidatePath))
{
return candidatePath;
}
currentDirectory = currentDirectory.Parent;
}
return string.Empty;
}
}
}