mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-25 20:16:14 -05:00
[spotify] Trigger scan after retrieving a valid access token from the
webinterface Library now offers the function "library_exec_async". This allows library sources to offer functions that will be executed in the library thread. Useful to allow partial scans of only one source.
This commit is contained in:
@@ -413,6 +413,9 @@ fptr_assign_all()
|
||||
// End of ugly part
|
||||
|
||||
|
||||
static enum command_state
|
||||
scan_webapi(void *arg, int *ret);
|
||||
|
||||
/* ------------------------------- MISC HELPERS ---------------------------- */
|
||||
|
||||
static int
|
||||
@@ -1993,7 +1996,8 @@ spotify_oauth_callback(struct evbuffer *evbuf, struct evkeyvalq *param, const ch
|
||||
// Received a valid access token
|
||||
spotify_access_token_valid = true;
|
||||
|
||||
// TODO Trigger init-scan after successful access to spotifywebapi
|
||||
// Trigger scan after successful access to spotifywebapi
|
||||
library_exec_async(scan_webapi, NULL);
|
||||
|
||||
evbuffer_add_printf(evbuf, "ok, all done</p>\n");
|
||||
|
||||
@@ -2312,6 +2316,14 @@ fullrescan()
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Thread: httpd */
|
||||
static enum command_state
|
||||
scan_webapi(void *arg, int *ret)
|
||||
{
|
||||
*ret = rescan();
|
||||
return COMMAND_END;
|
||||
}
|
||||
|
||||
/* Thread: main */
|
||||
int
|
||||
spotify_init(void)
|
||||
|
||||
Reference in New Issue
Block a user