static void biography_callback(const GEADAsyncHandler *handle, GEADStatus status, gpointer user_data) { Query *q = (Query *)user_data; GList *list = NULL; if(status == GEAD_PROGRESS) return; if(status == GEAD_DONE) { goffset size=0; const gchar *data = gmpc_easy_handler_get_data(handle, &size); char* url = __lastfm_art_xml_get_artist_bio(data, size); if(url) { MetaData *mtd = meta_data_new(); mtd->type = META_ARTIST_TXT; mtd->plugin_name = lastfm_plugin.name; mtd->content_type = META_DATA_CONTENT_HTML; mtd->content = url; mtd->size = -1; list = g_list_append(list, mtd); } } q->callback(list, q->user_data); g_slice_free(Query, q); }
static void album_info_callback(const GEADAsyncHandler *handle, GEADStatus status, gpointer user_data) { Query *q = (Query *)user_data; GList *list = NULL; if(status == GEAD_PROGRESS) return; if(status == GEAD_DONE) { goffset size=0; const gchar* data = gmpc_easy_handler_get_data(handle, &size); list = __lastfm_art_xml_get_album_info(data, size); } q->callback(list, q->user_data); g_slice_free(Query, q); }
/** * Similar artist */ static void similar_artist_callback(const GEADAsyncHandler *handle, GEADStatus status, gpointer user_data) { Query *q = (Query *)user_data; GList *list = NULL; if(status == GEAD_PROGRESS) return; if(status == GEAD_DONE) { goffset size=0; const gchar* data = gmpc_easy_handler_get_data(handle, &size); MetaData *mtd = __lastfm_art_xml_get_artist_similar(data, size); if(mtd){ list = g_list_append(list, mtd); } } q->callback(list, q->user_data); g_slice_free(Query, q); }