Freesound fixes for #5853, and a few other small improvements
[ardour.git] / gtk2_ardour / sfdb_freesound_mootcher.cc
index ed1e2abfebbe7b0496bf106188b73486c1501c0a..e46fb12391183ba2b093d3c23e20c46c45e403bd 100644 (file)
@@ -226,6 +226,7 @@ std::string Mootcher::searchText(std::string query, int page, std::string filter
                params += "&s=" + sortMethodString(sort);\r
 \r
        params += "&fields=id,original_filename,duration,filesize,samplerate,license,serve";\r
+       params += "&sounds_per_page=100";\r
 \r
        return doRequest("/sounds/search", params);\r
 }\r
@@ -318,12 +319,12 @@ std::string Mootcher::getAudioFile(std::string originalFileName, std::string ID,
                return "";\r
        }\r
 \r
-       //if already canceling a previous download, bail out here  ( this can happen b/c getAudioFile gets called by various UI update funcs )\r
+       // if already cancelling a previous download, bail out here  ( this can happen b/c getAudioFile gets called by various UI update funcs )\r
        if ( caller->freesound_download_cancel ) {\r
                return "";\r
        }\r
        \r
-       //now download the actual file\r
+       // now download the actual file\r
        FILE* theFile;\r
        theFile = g_fopen( audioFileName.c_str(), "wb" );\r
 \r
@@ -359,7 +360,10 @@ std::string Mootcher::getAudioFile(std::string originalFileName, std::string ID,
        caller->freesound_progress_bar.set_text("");\r
        \r
        if( res != 0 ) {\r
-               error <<  string_compose (_("curl error %1 (%2)"), res, curl_easy_strerror(res)) << endmsg;\r
+               /* it's not an error if the user pressed the stop button */\r
+               if (res != CURLE_ABORTED_BY_CALLBACK) {\r
+                       error <<  string_compose (_("curl error %1 (%2)"), res, curl_easy_strerror(res)) << endmsg;\r
+               }\r
                remove( audioFileName.c_str() );  \r
                return "";\r
        } else {\r