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