Esempio n. 1
0
static PyObject *
Link_from_search(Link * self, PyObject *args)
{
    Results *results;
    PyObject *plink;

    if (!PyArg_ParseTuple(args, "O!", &ResultsType, &results)) {
        return NULL;
    }
    sp_link *link = sp_link_create_from_search(results->_search);

    if (!link) {
        PyErr_SetString(SpotifyError, "Failed to get link from a search");
        return NULL;
    }
    plink = Link_FromSpotify(link);
    return plink;
}
Esempio n. 2
0
sp_search *
sp_search_create(sp_session *UNUSED(session), const char *query,
                 int UNUSED(tracks_offset), int UNUSED(tracks),
                 int UNUSED(albums_offset), int UNUSED(albums),
                 int UNUSED(artists_offset), int UNUSED(artists),
                 int UNUSED(playlist_offset), int UNUSED(playlists),
                 sp_search_type type,
                 search_complete_cb *UNUSED(cb), void *UNUSED(userdata))
{
  sp_link   *link;
  sp_search *search;

  search = ALLOC(sp_search);
  search->query = strclone(query);
  search->type  = type;
  link = sp_link_create_from_search(search);

  return (sp_search *)registry_find(link->data);
}