mirror of
https://github.com/jayfunc/BetterLyrics.git
synced 2026-01-12 19:08:33 +08:00
25 lines
621 B
C#
25 lines
621 B
C#
using ATL;
|
|
using System.IO;
|
|
|
|
namespace BetterLyrics.WinUI3.Extensions
|
|
{
|
|
public static class TrackExtensions
|
|
{
|
|
extension(Track track)
|
|
{
|
|
public string GetParentFolderName() => Directory.GetParent(track.Path)?.Name ?? "";
|
|
|
|
public string GetParentFolderPath() => Directory.GetParent(track.Path)?.FullName ?? "";
|
|
|
|
public string GetRawLyrics()
|
|
{
|
|
if (track.Path is string path)
|
|
{
|
|
return TagLib.File.Create(path).Tag.Lyrics;
|
|
}
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
}
|