Add GetPathForFile to BeatmapSetInfo

This is used in several places, and so should probably have a function rather than remaining as duplicated code.

Also applies this together with the previous commit to `BeatmapManagerWorkingBeatmap`.
This commit is contained in:
Naxess
2021-04-17 17:49:10 +02:00
parent 400f8b3938
commit b36da2664c
2 changed files with 8 additions and 9 deletions

View File

@ -59,6 +59,8 @@ namespace osu.Game.Beatmaps
public string StoryboardFile => Files?.Find(f => f.Filename.EndsWith(".osb", StringComparison.OrdinalIgnoreCase))?.Filename;
public string GetPathForFile(string filename) => Files?.SingleOrDefault(f => string.Equals(f.Filename, filename, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath;
public List<BeatmapSetFileInfo> Files { get; set; }
public override string ToString() => Metadata?.ToString() ?? base.ToString();