subsonic support is now added - no cache though

This commit is contained in:
Fufu Fang 2019-10-24 00:57:37 +01:00
parent a8ef8c88b5
commit 8206b4fa37
No known key found for this signature in database
GPG Key ID: 0F6BB5EF6F8BB729
2 changed files with 6 additions and 5 deletions

View File

@ -54,7 +54,7 @@ LinkTable *LinkSystem_init(const char *url)
* Note that cache system is enabled automatically if sonic mode is
* enabled
*/
if (CONFIG.cache_enabled || CONFIG.sonic_mode) {
if (CONFIG.cache_enabled) {
if (CONFIG.cache_dir) {
CacheSystem_init(CONFIG.cache_dir, 0);
} else {

View File

@ -93,11 +93,12 @@ static char *sonic_getMusicDirectory_link(const int id)
/**
* \brief generate a download request URL
*/
static char *sonic_download_link(const int id)
static char *sonic_stream_link(const int id)
{
char *first_part = sonic_gen_url_first_part("download");
char *first_part = sonic_gen_url_first_part("stream");
char *url = CALLOC(MAX_PATH_LEN + 1, sizeof(char));
snprintf(url, MAX_PATH_LEN, "%s&id=%d", first_part, id);
snprintf(url, MAX_PATH_LEN,
"%s&estimateContentLength=true&format=raw&id=%d", first_part, id);
free(first_part);
return url;
}
@ -211,7 +212,7 @@ static void XMLCALL XML_process_single_element(void *data, const char *elem,
strncpy(link->f_url, url, MAX_PATH_LEN);
free(url);
} else if (link->type == LINK_FILE) {
char *url = sonic_download_link(link->sonic_id);
char *url = sonic_stream_link(link->sonic_id);
strncpy(link->f_url, url, MAX_PATH_LEN);
free(url);
} else {