so://phie

verbal

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

blob: 7f0f3fc3280c71832306c2e25ff54a06db85623e (920 bytes)[doc][blame][raw]

1use serde::Deserialize;

2

3use crate::data;

4use crate::utils::{to_array, upgrade_to_https};

5

6#[derive(Debug, Clone, Deserialize)]

7pub struct Station {

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}

19

20impl Into<data::Station> for Station {

21 fn into(self) -> data::Station {

22 data::Station {

23 name: self.name,

24 stream_url: upgrade_to_https(self.url),

25 votes: self.votes,

26 favicon: Some(self.favicon),

27 homepage: Some(self.homepage),

28 tags: to_array(self.tags),

29 country: Some(self.countrycode),

30 languages: to_array(self.languagecodes),

31 state: Some(self.state),

32 is_favorite: false,

33 }

34 }

35}