so://phie

verbal

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]

1use serde::Serialize;

2

3use crate::model;

4use crate::utils::upgrade_to_https;

5

6#[derive(Debug, Serialize)]

7pub 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}

19

20impl 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}