so://phie

verbal

A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal

blob: 710432e1758aed3faed78719744e965089ddfb66 (932 bytes)[doc][blame][raw]

1use serde::Serialize;

2

3use crate::model;

4use crate::utils::upgrade_to_https;

5

6#[derive(Debug, Serialize)]

7pub struct Station {

8 pub uuid: String,

9 pub name: String,

10 pub stream_url: String,

11 pub votes: i32,

12 pub favicon: Option<String>,

13 pub homepage: Option<String>,

14 pub tags: Vec<String>,

15 pub country: Option<String>,

16 pub languages: Vec<String>,

17 pub state: Option<String>,

18 pub is_favorite: bool,

19}

20

21impl Into<Station> for model::Station {

22 fn into(self) -> Station {

23 Station {

24 uuid: self.uuid,

25 name: self.name,

26 stream_url: upgrade_to_https(self.stream_url),

27 votes: self.votes,

28 favicon: self.favicon,

29 homepage: self.homepage,

30 tags: self.tags,

31 country: self.country,

32 languages: self.languages,

33 state: self.state,

34 is_favorite: false,

35 }

36 }

37}