Closed Asteriskx closed 1 year ago
原因 https://github.com/Sagiri-Dev/Sagiri/blob/feature-misskey-nowplaying/Sagiri/Services/Spotify/Track/CurrentTrackInfo.cs#L78
var artist = track.Artists.Select(x => x.Name).FirstOrDefault();
上記実装なので、先頭分しか取得できない状態になっていた。
対応 IEnumerable な状態で取得した後に、状況に応じて文字列構築するように変更する。
var artists = track.Artists.Select(x => x.Name); StringBuilder sb = new(); foreach (var (item, index) in artists.Select((item, index) => (item, index))) { if (artists.Count() > 1) { if (index != artists.Count() - 1) sb.Append($"{item}, "); else sb.Append($"{item}"); } else sb.Append(item); }
原因 https://github.com/Sagiri-Dev/Sagiri/blob/feature-misskey-nowplaying/Sagiri/Services/Spotify/Track/CurrentTrackInfo.cs#L78
上記実装なので、先頭分しか取得できない状態になっていた。
対応 IEnumerable な状態で取得した後に、状況に応じて文字列構築するように変更する。