make get_playlist_data() generic.
[paraslash.git] / playlist.c
index 429ad2b53a116ffc1da2d4710b51e6db39161324..6f9f9669618377370daa1f330dd1b76f464eeb7e 100644 (file)
@@ -47,18 +47,6 @@ static int add_playlist_entry(char *path, void *data)
        return 1;
 }
 
        return 1;
 }
 
-static int get_playlist_data(struct osl_row *row, char **playlist_name,
-               struct osl_object *playlist_def)
-{
-       struct osl_object obj;
-       int ret = osl_get_object(playlists_table, row, BLOBCOL_NAME, &obj);
-       if (ret < 0)
-               return ret;
-       *playlist_name = obj.data;
-       return osl_open_disk_object(playlists_table, row, BLOBCOL_DEF,
-               playlist_def);
-}
-
 /* returns -E_PLAYLIST_LOADED on _success_ to terminate the loop */
 static int load_playlist(struct osl_row *row, void *data)
 {
 /* returns -E_PLAYLIST_LOADED on _success_ to terminate the loop */
 static int load_playlist(struct osl_row *row, void *data)
 {
@@ -67,7 +55,7 @@ static int load_playlist(struct osl_row *row, void *data)
        char *playlist_name;
        int ret;
 
        char *playlist_name;
        int ret;
 
-       ret = get_playlist_data(row, &playlist_name, &playlist_def);
+       ret = pl_get_name_and_def_by_row(row, &playlist_name, &playlist_def);
        if (ret < 0)
                goto err;
        playlist->length = 0;
        if (ret < 0)
                goto err;
        playlist->length = 0;
@@ -118,7 +106,7 @@ static int check_playlist(struct osl_row *row, void *data)
        struct para_buffer *pb = data;
        struct osl_object playlist_def;
        char *playlist_name;
        struct para_buffer *pb = data;
        struct osl_object playlist_def;
        char *playlist_name;
-       int ret = get_playlist_data(row, &playlist_name, &playlist_def);
+       int ret = pl_get_name_and_def_by_row(row, &playlist_name, &playlist_def);
 
        if (ret < 0) {
                para_printf(pb, "failed to get playlist data: %s\n",
 
        if (ret < 0) {
                para_printf(pb, "failed to get playlist data: %s\n",