init
This commit is contained in:
122
src/status.rs
Normal file
122
src/status.rs
Normal file
@@ -0,0 +1,122 @@
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct Notice {
|
||||
pub status: String, //"info",
|
||||
pub message: String, //"test message",
|
||||
pub details: String, //"test details",
|
||||
pub priority: bool, //false,
|
||||
pub url: String, //"hottub:\/\/upgrade?source=hottub"
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct Channel {
|
||||
pub id: String, //"hottub",
|
||||
pub name: String, //"Hot Tub Pro",
|
||||
pub description: String, //"Advanced search, filters, and more. Consider supporting the development of Hot Tub by upgrading to Hot Tub Pro.",
|
||||
pub premium: bool, //true,
|
||||
pub favicon: String, //"https:\/\/www.google.com/s2/favicons?sz=64&domain=https:\/\/hottubapp.io",
|
||||
pub status: String, //"active",
|
||||
pub categories: Vec<String>, //[],
|
||||
pub options: Vec<Channel_Option>,
|
||||
pub nsfw: bool, //true
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct Channel_Option {
|
||||
pub id: String, //"channels",
|
||||
pub title: String, //"Sites",
|
||||
pub description: String, //"Websites included in search results.",
|
||||
pub systemImage: String, //"network",
|
||||
pub colorName: String, //"purple",
|
||||
pub options: Vec<Filter_Option>, //[],
|
||||
pub multiSelect: bool, //true
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct Filter_Option{
|
||||
pub id: String, //"sort",
|
||||
pub title: String, //"Sort",
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct Options {
|
||||
pub id: String, //"sort",
|
||||
pub title: String, //"Sort",
|
||||
pub description: String, //"Sort the videos by new or old.",
|
||||
pub systemImage: String, //"sort.image",
|
||||
pub colorName: String, //"blue",
|
||||
pub options: Vec<Option_Value>,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct Option_Value {
|
||||
pub id: String, //"new",
|
||||
pub title: String, //"New",
|
||||
pub description: Option<String>, //"Sort the videos by new or old."
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct Subscription {
|
||||
pub status: String, //"incomplete"
|
||||
}
|
||||
|
||||
impl Subscription {
|
||||
pub fn new() -> Self {
|
||||
Subscription {
|
||||
status: "incomplete".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
pub struct Status {
|
||||
pub id: String, //"spacemoehrehottub",
|
||||
pub name: String, //"SpaceMoehre's Hot Tub",
|
||||
pub subtitle: String, //"More sources, more videos, more fun!",
|
||||
pub description: String, //"SpaceMoehre's Hot Tub is a source for finding videos from various websites.",
|
||||
pub iconUrl: String, //"https://hottubapp.io/files/hottub/appicon.png",
|
||||
pub color: String, //"\#A700FF",
|
||||
pub status: String, //"normal",
|
||||
pub notices: Vec<Notice>,
|
||||
pub channels: Vec<Channel>,
|
||||
pub subscription: Subscription,
|
||||
pub nsfw: bool,
|
||||
pub categories: Vec<String>,
|
||||
pub options: Vec<Options>,
|
||||
pub filtersFooter: String, //"Help us improve our algorithms by selecting the categories that best describe you. These will not necessarily affect your search results, but will help us tailor the app to your interests."
|
||||
}
|
||||
impl Status {
|
||||
pub fn new() -> Self {
|
||||
Status {
|
||||
id: "spacemoehre".to_string(),
|
||||
name: "SpaceMoehre's Hot Tub".to_string(),
|
||||
subtitle: "More sources, more videos, more fun!".to_string(),
|
||||
description:
|
||||
"SpaceMoehre's Hot Tub is a source for finding videos from various websites."
|
||||
.to_string(),
|
||||
iconUrl: "https://hottubapp.io/files/hottub/appicon.png".to_string(),
|
||||
color: "#FFA500".to_string(),
|
||||
status: "normal".to_string(),
|
||||
notices: vec![],
|
||||
channels: vec![],
|
||||
subscription: Subscription::new(),
|
||||
nsfw: true,
|
||||
categories: vec![],
|
||||
options: vec![],
|
||||
filtersFooter:
|
||||
"Help us improve our algorithms by giving us your feedback on the hottub discord."
|
||||
.to_string(),
|
||||
}
|
||||
}
|
||||
pub fn add_notice(&mut self, notice: Notice) {
|
||||
self.notices.push(notice);
|
||||
}
|
||||
pub fn add_channel(&mut self, channel: Channel) {
|
||||
self.channels.push(channel);
|
||||
}
|
||||
pub fn add_option(&mut self, option: Options) {
|
||||
self.options.push(option);
|
||||
}
|
||||
pub fn add_category(&mut self, category: String) {
|
||||
self.categories.push(category);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user