internal static PlaylistItem ToPlaylistItem(this BaseItemDto item, IExtendedApiClient apiClient) { var streamUrl = apiClient.GetAudioStreamUrl(new StreamOptions { AudioBitRate = 128, AudioCodec = AudioCodecs.Mp3, ItemId = item.Id, OutputFileExtension = "mp3", }); return(new PlaylistItem { Album = item.Album, Artist = item.Artists.Any() ? item.Artists[0] : "", TrackName = item.Name, TrackUrl = streamUrl, MediaBrowserId = item.Id, IsJustAdded = true, ImageUrl = (string)new Converters.ImageUrlConverter().Convert(item, typeof(string), null, null), }); }