static void updater_remove_directory (updater_t *updater, GFile *file) { xmmsc_result_t *res; xmmsv_t *univ, *coll; gchar *path, *pattern, *encoded; path = g_file_get_path (file); encoded = xmmsv_encode_url (path); g_free (path); pattern = g_strdup_printf ("file://%s/*", encoded); g_free (encoded); univ = xmmsv_new_coll (XMMS_COLLECTION_TYPE_UNIVERSE); coll = xmmsv_new_coll (XMMS_COLLECTION_TYPE_MATCH); xmmsv_coll_add_operand (coll, univ); xmmsv_coll_attribute_set_string (coll, "field", "url"); xmmsv_coll_attribute_set_string (coll, "value", pattern); xmmsv_coll_attribute_set_string (coll, "case-sensitive", "true"); g_debug ("remove '%s' from mlib", pattern); res = xmmsc_coll_query_ids (updater->conn, coll, NULL, 0, 0); xmmsc_result_notifier_set (res, updater_remove_directory_by_id, updater); xmmsc_result_unref (res); xmmsv_unref (coll); xmmsv_unref (univ); g_free (pattern); }
/** * Browse available media in a path. * * Retrieves a list of paths available (directly) under the specified * path. * */ xmmsc_result_t * xmmsc_xform_media_browse (xmmsc_connection_t *c, const char *url) { char *enc_url; xmmsc_result_t *res; x_check_conn (c, NULL); x_api_error_if (!url, "with a NULL url", NULL); enc_url = xmmsv_encode_url (url); if (!enc_url) return NULL; res = xmmsc_xform_media_browse_encoded (c, enc_url); free (enc_url); return res; }