Skip to content

Commit

Permalink
Unify changelogs (Nyanotrasen#1547)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vordenburg authored May 9, 2023
1 parent 33ce38a commit 7be46c3
Show file tree
Hide file tree
Showing 4 changed files with 3,848 additions and 3,344 deletions.
19 changes: 2 additions & 17 deletions Content.Client/Changelog/ChangelogManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,11 @@ public async void Initialize()
NewChangelogEntriesChanged?.Invoke();
}

public async Task<List<ChangelogEntry>> LoadChangelog()
{
var paths = _resource.ContentFindFiles("/Changelog/")
.Where(filePath => filePath.Extension == "yml")
.ToArray();

var result = new List<ChangelogEntry>();
foreach (var path in paths)
{
var changelog = await LoadChangelogFile(path);
result = result.Union(changelog).ToList();
}
return result.OrderBy(x => x.Time).ToList();
}

private Task<List<ChangelogEntry>> LoadChangelogFile(ResPath path)
public Task<List<ChangelogEntry>> LoadChangelog()
{
return Task.Run(() =>
{
var yamlData = _resource.ContentFileReadYaml(path);
var yamlData = _resource.ContentFileReadYaml(new ("/Changelog/Changelog.yml"));

if (yamlData.Documents.Count == 0)
return new List<ChangelogEntry>();
Expand Down
Loading

0 comments on commit 7be46c3

Please sign in to comment.