so://phie

verbal

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

blob: 2fea83f7522fa26a03f5ea09da05dbd29b0dd812 (1389 bytes)[doc][blame][raw]

1use serde::Serialize;

2use diesel::Queryable;

3

4#[derive(Debug, Serialize, Queryable)]

5pub struct Account {

6 pub id: i32,

7 pub username: Option<String>,

8 pub language: String,

9 pub is_playback_history: bool,

10}

11

12#[derive(Debug, Serialize, Queryable)]

13pub struct Device {

14 pub id: i32,

15 pub token: String,

16 pub account_id: i32,

17}

18

19#[derive(Debug, Serialize, Queryable)]

20pub struct Station {

21 pub id: i32,

22 pub uuid: String,

23 pub name: String,

24 pub stream_url: String,

25 pub votes: i32,

26 pub favicon: Option<String>,

27 pub homepage: Option<String>,

28 pub tags: Vec<String>,

29 pub country: Option<String>,

30 pub languages: Vec<String>,

31 pub state: Option<String>,

32}

33

34#[derive(Debug, Serialize, Queryable)]

35pub struct Favorite {

36 pub id: i32,

37 pub account_id: i32,

38 pub station_id: i32,

39}

40

41// use rand::{distributions::Alphanumeric, Rng};

42

43// #[derive(Debug, Deserialize, Serialize, FromRow)]

44// pub struct Code {

45// pub code: String,

46// pub used: bool,

47// pub expired: bool,

48// }

49

50// impl Code {

51// pub fn new() -> Self {

52// let code = rand::thread_rng()

53// .sample_iter(&Alphanumeric)

54// .take(6)

55// .map(char::from)

56// .map(|c| c.to_uppercase().to_string())

57// .collect::<String>();

58// Self { code, used: false, expired: false }

59// }

60// }