A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
blob: 0a79aacea68d0ca588a3b225c36e7bd1d5ec4b18 (1320 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 Account {8
pub username: Option<String>,9
pub language: String,10
pub is_playback_history: bool,11
}13
impl Into<Account> for model::Account {14
fn into(self) -> Account {15
Account {16
username: self.username,17
language: self.language,18
is_playback_history: self.is_playback_history,19
}20
}21
}23
#[derive(Debug, Serialize)]24
pub struct Station {25
pub uuid: String,26
pub name: String,27
pub stream_url: String,28
pub votes: i32,29
pub favicon: Option<String>,30
pub homepage: Option<String>,31
pub tags: Vec<String>,32
pub country: Option<String>,33
pub languages: Vec<String>,34
pub state: Option<String>,35
pub is_favorite: bool,36
}38
impl Into<Station> for model::Station {39
fn into(self) -> Station {40
Station {41
uuid: self.uuid,42
name: self.name,43
stream_url: upgrade_to_https(self.stream_url),44
votes: self.votes,45
favicon: self.favicon,46
homepage: self.homepage,47
tags: self.tags,48
country: self.country,49
languages: self.languages,50
state: self.state,51
is_favorite: false,52
}53
}54
}