public void FetchNews(bool repeatViewed) { downloadNews(); unpackNews(); _unreadNews = Directory.GetFiles(_unreadNewsDir, "*.txt", SearchOption.TopDirectoryOnly) .Where(file => repeatViewed || !File.Exists(getReadNewsFile(file))) .OrderByDescending(Path.GetFileNameWithoutExtension, _versionComparer) .ToList(); NewsFetched?.Invoke(); }
public async Task FetchNews(bool repeatViewed, CancellationToken token) { await downloadNews(token); unpackNews(); _unreadNews = _unreadNewsDir.EnumerateFiles("*.txt") .Where(file => repeatViewed || !getReadNewsFile(file).IsFile()) .OrderByDescending(_ => _.Basename(extension: false), _versionComparer) .ToList(); NewsFetched?.Invoke(); }