protected virtual string GetSecondLineText (TrackInfo track)
{
string markup = null;
Banshee.Streaming.RadioTrackInfo radio_track = track as Banshee.Streaming.RadioTrackInfo;
if ((track.MediaAttributes & TrackMediaAttributes.Podcast) != 0) {
// Translators: {0} and {1} are for markup so ignore them, {2} and {3}
// are Podcast Name and Published Date, respectively;
// e.g. 'from BBtv published 7/26/2007'
markup = MarkupFormat (Catalog.GetString ("{0}from{1} {2} {0}published{1} {3}"),
track.DisplayAlbumTitle, track.ReleaseDate.ToShortDateString ());
} else if (radio_track != null && radio_track.ParentTrack != null) {
// This is complicated because some radio streams send tags when the song changes, and we
// want to display them if they do. But if they don't, we want it to look good too, so we just
// display the station name for the second line.
string by_from = GetByFrom (
track.ArtistName == radio_track.ParentTrack.ArtistName ? null : track.ArtistName, track.DisplayArtistName,
track.AlbumTitle == radio_track.ParentTrack.AlbumTitle ? null : track.AlbumTitle, track.DisplayAlbumTitle, false
);
if (String.IsNullOrEmpty (by_from)) {
// simply: "Chicago Public Radio" or whatever the artist name is
markup = GLib.Markup.EscapeText (radio_track.ParentTrack.ArtistName ?? Catalog.GetString ("Unknown Stream"));
} else {
// Translators: {0} and {1} are markup so ignore them, {2} is the name of the radio station
string on = MarkupFormat (Catalog.GetString ("{0}on{1} {2}"), radio_track.ParentTrack.TrackTitle);
// Translators: {0} is the "from {album} by {artist}" type string, and {1} is the "on {radio station name}" string
markup = String.Format (Catalog.GetString ("{0} {1}"), by_from, on);
}
} else {
markup = GetByFrom (track.ArtistName, track.DisplayArtistName, track.AlbumTitle, track.DisplayAlbumTitle, true);
}
return String.Format ("<span color=\"{0}\">{1}</span>",
CairoExtensions.ColorGetHex (TextColor, false),
markup);
}