diff --git a/src/playlist.c b/src/playlist.c
index 0a448333c77a07f718b882a005bf6a48518307c0..564cee6b727d82d7be851b77950a7dc3703b2952 100644 (file)
--- a/src/playlist.c
+++ b/src/playlist.c
for (i = 0; i < playlist->list->len; ++i) {
struct mpd_song *song = playlist_get(playlist, i);
- mpd_freeSong(song);
+ mpd_song_free(song);
}
g_ptr_array_set_size(playlist->list, 0);
}
struct mpd_song *
-playlist_lookup_song(mpdclient_t *c, gint id)
+playlist_lookup_song(mpdclient_t *c, unsigned id)
{
guint i;
for (i = 0; i < c->playlist.list->len; ++i) {
struct mpd_song *song = playlist_get(&c->playlist, i);
- if (song->id == id)
+ if (mpd_song_get_id(song) == id)
return song;
}
}
gint
-playlist_get_index_from_id(const struct mpdclient *c, gint id)
+playlist_get_index_from_id(const struct mpdclient *c, unsigned id)
{
guint i;
for (i = 0; i < c->playlist.list->len; ++i) {
const struct mpd_song *song = playlist_get(&c->playlist, i);
- if (song->id == id)
+ if (mpd_song_get_id(song) == id)
return (gint)i;
}
for (i = 0; i < c->playlist.list->len; ++i) {
struct mpd_song *song = playlist_get(&c->playlist, i);
- if(strcmp(song->file, filename) == 0)
+ const char *uri = mpd_song_get_uri(song);
+
+ if (uri != NULL && strcmp(uri, filename) == 0)
return (gint)i;
}