Пример #1
0
static void
subscribe_selected_feed (RBPodcastAddDialog *dialog)
{
	RBPodcastChannel *channel;

	g_assert (dialog->priv->have_selection);

	rhythmdb_entry_delete_by_type (dialog->priv->db, RHYTHMDB_ENTRY_TYPE_PODCAST_SEARCH);
	rhythmdb_commit (dialog->priv->db);

	/* subscribe selected feed */
	gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->feed_model),
			    &dialog->priv->selected_feed,
			    FEED_COLUMN_PARSED_FEED, &channel,
			    -1);
	if (channel->posts != NULL) {
		rb_podcast_manager_add_parsed_feed (dialog->priv->podcast_mgr, channel);
	} else {
		rb_podcast_manager_subscribe_feed (dialog->priv->podcast_mgr, channel->url, TRUE);
	}
}
Пример #2
0
static void
impl_add_uri (RBSource *source,
	      const char *uri,
	      const char *title,
	      const char *genre,
	      RBSourceAddCallback callback,
	      gpointer data,
	      GDestroyNotify destroy_data)
{
	RBPodcastManager *podcast_mgr;

	g_object_get (source, "podcast-manager", &podcast_mgr, NULL);
	rb_podcast_manager_subscribe_feed (podcast_mgr, uri, FALSE);
	g_object_unref (podcast_mgr);

	if (callback != NULL) {
		callback (source, uri, data);
		if (destroy_data != NULL) {
			destroy_data (data);
		}
	}
}