implemented search artists in MusicBrainz
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user