static gboolean save_playlist_foreach (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, SavePlaylistData *data) { RBGenericPlayerPlaylistSourcePrivate *priv = GET_PRIVATE (data->source); RhythmDBEntry *entry; TotemPlPlaylistIter pl_iter; const char *host_uri; char *uri; entry = rhythmdb_query_model_iter_to_entry (RHYTHMDB_QUERY_MODEL (model), iter); if (entry == NULL) { return FALSE; } host_uri = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION); uri = rb_generic_player_source_uri_to_playlist_uri (priv->player_source, host_uri, data->playlist_type); totem_pl_playlist_append (data->playlist, &pl_iter); totem_pl_playlist_set (data->playlist, &pl_iter, TOTEM_PL_PARSER_FIELD_URI, uri, NULL); set_field_from_property (data->playlist, &pl_iter, entry, RHYTHMDB_PROP_ARTIST, TOTEM_PL_PARSER_FIELD_AUTHOR); set_field_from_property (data->playlist, &pl_iter, entry, RHYTHMDB_PROP_GENRE, TOTEM_PL_PARSER_FIELD_GENRE); set_field_from_property (data->playlist, &pl_iter, entry, RHYTHMDB_PROP_ALBUM, TOTEM_PL_PARSER_FIELD_ALBUM); set_field_from_property (data->playlist, &pl_iter, entry, RHYTHMDB_PROP_TITLE, TOTEM_PL_PARSER_FIELD_TITLE); rhythmdb_entry_unref (entry); g_free (uri); return FALSE; }
static void save_playlist_entry (GtkTreeModel *model, GtkTreeIter *iter, char **uri, char **title, gboolean *custom_title, RBGenericPlayerPlaylistSource *source) { RBGenericPlayerPlaylistSourcePrivate *priv = GET_PRIVATE (source); RhythmDBEntry *entry; const char *host_uri; entry = rhythmdb_query_model_iter_to_entry (RHYTHMDB_QUERY_MODEL (model), iter); if (entry == NULL) { return; } host_uri = rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION); *uri = rb_generic_player_source_uri_to_playlist_uri (priv->player_source, host_uri); *title = rhythmdb_entry_dup_string (entry, RHYTHMDB_PROP_TITLE); *custom_title = TRUE; }