static void
request_cover_art (MxFrame *frame, RhythmDBEntry *entry)
{
    RBExtDBKey *key;
    RBExtDB *art_store;

    art_store = rb_ext_db_new ("album-art");

    key = rhythmdb_entry_create_ext_db_key (entry, RHYTHMDB_PROP_ALBUM);
    rb_ext_db_request (art_store, key, (RBExtDBRequestCallback) art_cb, g_object_ref (frame), g_object_unref);
    rb_ext_db_key_free (key);

    g_object_unref (art_store);
}
static void
update_current_playing_data (RBNotificationPlugin *plugin, RhythmDBEntry *entry)
{
	GValue *value;
	const char *stream_title = NULL;
	char *artist = NULL;
	char *album = NULL;
	char *title = NULL;
	GString *secondary;
	RBExtDBKey *key;

	const char *artist_template = NULL;
	const char *album_template = NULL;

	g_free (plugin->current_title);
	g_free (plugin->current_album_and_artist);
	plugin->current_title = NULL;
	plugin->current_album_and_artist = NULL;

	if (entry == NULL) {
		plugin->current_title = g_strdup (_("Not Playing"));
		plugin->current_album_and_artist = g_strdup ("");
		g_free (plugin->notify_art_path);
		plugin->notify_art_path = NULL;
		return;
	}

	secondary = g_string_sized_new (100);

	if (plugin->notify_art_key == NULL ||
	    (rhythmdb_entry_matches_ext_db_key (plugin->db, entry, plugin->notify_art_key) == FALSE)) {
		if (plugin->notify_art_key)
			rb_ext_db_key_free (plugin->notify_art_key);
		plugin->notify_art_key = NULL;
		g_free (plugin->notify_art_path);
		plugin->notify_art_path = NULL;

		/* request album art */
		key = rhythmdb_entry_create_ext_db_key (entry, RHYTHMDB_PROP_ALBUM);
		rb_ext_db_request (plugin->art_store,
				   key,
				   (RBExtDBRequestCallback) art_cb,
				   g_object_ref (plugin),
				   g_object_unref);
		rb_ext_db_key_free (key);
	}

	/* get artist, preferring streaming song details */
	value = rhythmdb_entry_request_extra_metadata (plugin->db,
						       entry,
						       RHYTHMDB_PROP_STREAM_SONG_ARTIST);
	if (value != NULL) {
		artist = markup_escape (g_value_get_string (value));
		g_value_unset (value);
		g_free (value);
	} else {
		artist = markup_escape (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ARTIST));
	}

	/* get album, preferring streaming song details */
	value = rhythmdb_entry_request_extra_metadata (plugin->db,
						       entry,
						       RHYTHMDB_PROP_STREAM_SONG_ALBUM);
	if (value != NULL) {
		album = markup_escape (g_value_get_string (value));
		g_value_unset (value);
		g_free (value);
	} else {
		album = markup_escape (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_ALBUM));
	}

	get_artist_album_templates (artist, album, &artist_template, &album_template);

	if (artist != NULL && artist[0] != '\0') {
		g_string_append_printf (secondary, artist_template, artist);
	}
	g_free (artist);

	if (album != NULL && album[0] != '\0') {
		if (secondary->len != 0)
			g_string_append_c (secondary, ' ');

		g_string_append_printf (secondary, album_template, album);
	}
	g_free (album);

	/* get title and possibly stream name.
	 * if we have a streaming song title, the entry's title
	 * property is the stream name.
	 */
	value = rhythmdb_entry_request_extra_metadata (plugin->db,
						       entry,
						       RHYTHMDB_PROP_STREAM_SONG_TITLE);
	if (value != NULL) {
		title = g_value_dup_string (value);
		g_value_unset (value);
		g_free (value);

		stream_title = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_TITLE);
	} else {
		title = g_strdup (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_TITLE));
	}

	if (stream_title != NULL && stream_title[0] != '\0') {
		char *escaped;

		escaped = markup_escape (stream_title);
		if (secondary->len == 0)
			g_string_append (secondary, escaped);
		else
			g_string_append_printf (secondary, " (%s)", escaped);
		g_free (escaped);
	}

	if (title == NULL) {
		/* Translators: unknown track title */
		title = g_strdup (_("Unknown"));
	}

	plugin->current_title = title;
	plugin->current_album_and_artist = g_string_free (secondary, FALSE);
}