Adjust file read async functions

This commit is contained in:
1hitsong 2022-09-22 09:00:07 -04:00
parent a50bdb4770
commit 97409adb45
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ public class LrcLyricProvider : ILyricProvider
} }
var fileMetaData = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); var fileMetaData = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
string lrcFileContent = await Task.FromResult(File.ReadAllText(lyricFilePath)).ConfigureAwait(false); string lrcFileContent = await File.ReadAllTextAsync(lyricFilePath).ConfigureAwait(false);
Song lyricData; Song lyricData;

View File

@ -39,7 +39,7 @@ public class TxtLyricProvider : ILyricProvider
return null; return null;
} }
string[] lyricTextLines = await Task.FromResult(File.ReadAllLines(lyricFilePath)).ConfigureAwait(false); string[] lyricTextLines = await File.ReadAllLinesAsync(lyricFilePath).ConfigureAwait(false);
if (lyricTextLines.Length == 0) if (lyricTextLines.Length == 0)
{ {