mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-12 19:08:33 +08:00
- Add album text in lyrics render - Improve song info update and draw algo - Upgrade to .NET 10
27 lines
661 B
C#
27 lines
661 B
C#
using System.IO;
|
|
|
|
namespace BetterLyrics.WinUI3.Helper
|
|
{
|
|
public static class TrackHelper
|
|
{
|
|
public static string GetParentFolderName(this ATL.Track track)
|
|
{
|
|
return Directory.GetParent(track.Path)?.Name ?? "";
|
|
}
|
|
|
|
public static string GetParentFolderPath(this ATL.Track track)
|
|
{
|
|
return Directory.GetParent(track.Path)?.FullName ?? "";
|
|
}
|
|
|
|
public static string GetLyrics(this ATL.Track track)
|
|
{
|
|
if (track.Path is string path)
|
|
{
|
|
return TagLib.File.Create(path).Tag.Lyrics;
|
|
}
|
|
return "";
|
|
}
|
|
}
|
|
}
|