Fix playlist item displays as empty string if no unicode title is present

This commit is contained in:
PercyDan54 2021-07-03 18:12:22 +08:00
parent ace57a9ee9
commit 12371f7424
No known key found for this signature in database
GPG Key ID: 6AEA7C525131BAF3

View File

@ -94,7 +94,10 @@ namespace osu.Game.Beatmaps
public RomanisableString ToRomanisableString()
{
string author = Author == null ? string.Empty : $"({Author})";
return new RomanisableString($"{ArtistUnicode} - {TitleUnicode} {author}".Trim(), $"{Artist} - {Title} {author}".Trim());
var artistUnicode = string.IsNullOrEmpty(ArtistUnicode) ? Artist : ArtistUnicode;
var titleUnicode = string.IsNullOrEmpty(TitleUnicode) ? Title : TitleUnicode;
return new RomanisableString($"{artistUnicode} - {titleUnicode} {author}".Trim(), $"{Artist} - {Title} {author}".Trim());
}
[JsonIgnore]