Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update for libspotify 11.1.60

  • Loading branch information...
commit a17a5dc4c2efd6dcaa4084588c0700ac6b6141f8 1 parent e8a3dc0
@Schnouki authored
Showing with 17 additions and 4 deletions.
  1. +1 −1  CMakeLists.txt
  2. +13 −0 src/commands.c
  3. +3 −3 src/spotify.c
View
2  CMakeLists.txt
@@ -29,7 +29,7 @@ find_package(PkgConfig)
set(targets)
# Check for libspotify
-pkg_check_modules(SPOTIFY REQUIRED libspotify>=10.1.16)
+pkg_check_modules(SPOTIFY REQUIRED libspotify>=11.1.60)
string(REPLACE ";" " " SPOTIFY_CFLAGS "${SPOTIFY_CFLAGS}")
# Check for required libraries
View
13 src/commands.c
@@ -1261,6 +1261,19 @@ static void _search_cb(sp_search* srch, gpointer userdata) {
}
json_builder_end_array(ctx->jb);
+ /* Playlists... */
+ jb_add_int(ctx->jb, "total_playlists", sp_search_total_playlists(srch));
+ n = sp_search_num_playlists(srch);
+ json_builder_set_member_name(ctx->jb, "playlists");
+ json_builder_begin_array(ctx->jb);
+ for (i=0; i < n; i++) {
+ json_builder_begin_object(ctx->jb);
+ jb_add_string(ctx->jb, "name", sp_search_playlist_name(srch, i));
+ jb_add_string(ctx->jb, "uri", sp_search_playlist_uri(srch, i));
+ json_builder_end_object(ctx->jb);
+ }
+ json_builder_end_array(ctx->jb);
+
/* And we're done! */
_s_cb_clean:
sp_search_release(srch);
View
6 src/spotify.c
@@ -150,7 +150,7 @@ void session_login(const char* username, const char* password) {
if (!g_session)
g_error("Session is not ready.");
- sp_session_login(g_session, username, password, TRUE);
+ sp_session_login(g_session, username, password, TRUE, NULL);
}
void session_logout() {
g_debug("Logging out...");
@@ -531,8 +531,8 @@ sp_artistbrowse* artistbrowse_create(sp_artist* artist, artistbrowse_complete_cb
sp_search* search_create(const gchar* query, search_complete_cb* callback, gpointer userdata) {
int nb_results = config_get_int_opt("search_results", 100);
return sp_search_create(g_session, query,
- 0, nb_results, 0, nb_results, 0, nb_results,
- callback, userdata);
+ 0, nb_results, 0, nb_results, 0, nb_results, 0, nb_results,
+ SP_SEARCH_STANDARD, callback, userdata);
}
Please sign in to comment.
Something went wrong with that request. Please try again.