A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: 11c792a753b2e1ce311eea46c386bc1a710a0a35 (956 bytes)[doc][blame][raw]
1
use serde::Deserialize;3
use crate::data;4
use crate::utils::{to_array, upgrade_to_https};6
#[derive(Debug, Clone, Deserialize)]7
pub struct Station {8
pub stationuuid: String,9
pub name: String,10
pub url: String,11
pub votes: i32,12
pub favicon: String,13
pub homepage: String,14
pub tags: String,15
pub countrycode: String,16
pub languagecodes: String,17
pub state: String,18
}20
impl Into<data::Station> for Station {21
fn into(self) -> data::Station {22
data::Station {23
uuid: self.stationuuid,24
name: self.name,25
stream_url: upgrade_to_https(self.url),26
votes: self.votes,27
favicon: Some(self.favicon),28
homepage: Some(self.homepage),29
tags: to_array(self.tags),30
country: Some(self.countrycode),31
languages: to_array(self.languagecodes),32
state: Some(self.state),33
is_favorite: false,34
}35
}36
}