Compare commits

...

2 Commits

Author SHA1 Message Date
Colin Fletcher 1e0d14f429 freesound: don't exclude mp3s
Ardour can import MP3s nowadays: no need to exclude them from Freesound
search results any more.
2022-05-23 18:15:43 +01:00
Colin Fletcher 1516dcc529 freesound: handle https:// licence URLs
Relax the check for matching licence URLs so that https:// as well as
http:// (and indeed any protocol at all) URLs match.
2022-05-23 18:15:02 +01:00
1 changed files with 5 additions and 9 deletions

View File

@ -1215,11 +1215,7 @@ SoundFileBrowser::freesound_search()
std::string theString = mootcher.searchText(
search_string,
freesound_page,
#ifdef __APPLE__
"", // OSX eats anything incl mp3
#else
"type:(wav OR aiff OR flac OR aif OR ogg OR oga)",
#endif
"",
sort_method
);
@ -1345,13 +1341,13 @@ SoundFileBrowser::handle_freesound_results(std::string theString) {
/* see http://www.freesound.org/help/faq/#licenses */
char shortlicense[64];
if(!licence.compare(0, 42, "http://creativecommons.org/licenses/by-nc/")){
if (licence.find("://creativecommons.org/licenses/by-nc/") != std::string::npos){
sprintf(shortlicense, "CC-BY-NC");
} else if(!licence.compare(0, 39, "http://creativecommons.org/licenses/by/")) {
} else if (licence.find ("://creativecommons.org/licenses/by/") != std::string::npos) {
sprintf(shortlicense, "CC-BY");
} else if(!licence.compare("http://creativecommons.org/licenses/sampling+/1.0/")) {
} else if (licence.find ("://creativecommons.org/licenses/sampling+/1.0/") != std::string::npos) {
sprintf(shortlicense, "sampling+");
} else if(!licence.compare(0, 40, "http://creativecommons.org/publicdomain/")) {
} else if (licence.find ("://creativecommons.org/publicdomain/") != std::string::npos) {
sprintf(shortlicense, "PD");
} else {
snprintf(shortlicense, 64, "%s", licence.c_str());