예제 #1
0
파일: dbUtils.c 프로젝트: GunioRobot/mpd
static int
directoryAddSongToStoredPlaylist(struct song *song, void *_data)
{
	struct add_data *data = _data;

	if (spl_append_song(data->path, song) != 0)
		return -1;
	return 0;
}
예제 #2
0
enum playlist_result
spl_append_uri(const char *url, const char *utf8file)
{
	struct song *song;

	if (uri_has_scheme(url)) {
		enum playlist_result ret;

		song = song_remote_new(url);
		ret = spl_append_song(utf8file, song);
		song_free(song);
		return ret;
	} else {
		song = db_get_song(url);
		if (song == NULL)
			return PLAYLIST_RESULT_NO_SUCH_SONG;

		return spl_append_song(utf8file, song);
	}
}
예제 #3
0
bool
spl_append_uri(const char *url, const char *utf8file, GError **error_r)
{
    struct song *song;

    if (uri_has_scheme(url)) {
        song = song_remote_new(url);
        bool success = spl_append_song(utf8file, song, error_r);
        song_free(song);
        return success;
    } else {
        song = db_get_song(url);
        if (song == NULL) {
            g_set_error_literal(error_r, playlist_quark(),
                                PLAYLIST_RESULT_NO_SUCH_SONG,
                                "No such song");
            return false;
        }

        return spl_append_song(utf8file, song, error_r);
    }
}