A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: ba289c6ab3dec051f820d8c5b957edf169d7f9e5 (482 bytes)[doc][blame][raw]
1
use regex::Regex;3
pub fn to_array(value: String) -> Vec<String> {4
value.split(",")5
.map(str::to_string)6
.filter(|tag| tag.trim().len() > 0)7
.collect::<Vec<String>>()8
}10
pub fn upgrade_to_https(url: String) -> String {11
if Regex::new("^http://")12
.unwrap()13
.is_match(&url)14
{15
/* TODO: include in config struct */16
return format!("https://api.radio.typable.dev/pass?redirect={}", &url);17
}18
url19
}