Exemple #1
0
 public static async Task SaveLyrics(this Audio audio, int i, VkApi vkApi, FilesystemTools filesystemTools, DirectoryInfo dir, CancellationToken token, ILog log)
 {
     if (audio.LyricsId != null)
     {
         var filename = $"{i} {audio.GetName()}.txt";
         await filesystemTools.WriteFileWithCompletionMark(dir, filename, async() =>
         {
             var lyrics = await vkApi.Audio.GetLyricsAsync(audio.LyricsId.Value);
             return(lyrics.Text);
         }, token, log);
     }
 }