Comment 4 for bug 451086

Revision history for this message
Mirco Müller (macslow) wrote :

Here's how rhythmbox should go about this case when second song lacks cover-art (pseudo-code):

// create a new bubble for first song
image_file = get_cover_art_image (song_one);
if (image_file)
 n = notification_new ("Song one", "Artist one, Album one", image_file);
else
 n = notification_new ("Song one", "Artist one, Album one", " "); // note the space between the last double-quote pair

notification_show (n);

// update current bubble
image_file = get_cover_art_image (song_two);
if (image_file)
 notification_update (n, "Song two", "Artist two, Album two", image_file);
else
 notification_update (n, "Song two", "Artist two, Album two", " "); // note the space between the last double-quote pair

notification_show (n);

According to you example-case the first song will have a cover-image, thus the if-branch will be executed (resulting in an icon-summary-body layout case). For the second song the else-branch will be executed, because it lacks a cover-image. Then the filename will be a simple single space (and result in a summary-body layout case). This is needed for notify-osd to be able to determine the bubble-layout and distinguish update- from append-cases.