A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: 8809ea1eb917fae5db3fedf8c51536beab2926d8 (943 bytes)[doc][blame][raw]
1
use serde::Deserialize;3
use crate::models::Station;4
use crate::utils::{to_array, upgrade_to_https};6
#[derive(Debug, Deserialize)]7
pub struct StationAdapter {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<Station> for StationAdapter {21
fn into(self) -> Station {22
Station {23
id: 0,24
uuid: self.stationuuid,25
name: self.name,26
stream_url: upgrade_to_https(self.url),27
votes: self.votes,28
favicon: Some(self.favicon),29
homepage: Some(self.homepage),30
tags: to_array(self.tags),31
country: Some(self.countrycode),32
languages: to_array(self.languagecodes),33
state: Some(self.state),34
}35
}36
}