using System.IO; namespace MediaBrowser.Controller.Lyrics; /// /// Lyric helper methods. /// public static class LyricInfo { /// /// Gets matching lyric file for a requested item. /// /// The lyricProvider interface to use. /// Path of requested item. /// Lyric file path if passed lyric provider's supported media type is found; otherwise, null. public static string? GetLyricFilePath(ILyricProvider lyricProvider, string itemPath) { foreach (string lyricFileExtension in lyricProvider.SupportedMediaTypes) { var lyricFilePath = Path.ChangeExtension(itemPath, lyricFileExtension); if (File.Exists(lyricFilePath)) { return lyricFilePath; } } return null; } }