fixes and cleanup
This commit is contained in:
@@ -37,17 +37,18 @@ pub struct VideosRequest {
|
||||
pub channel: Option<String>, //"youtube",
|
||||
pub sort: Option<String>, //"new",
|
||||
pub query: Option<String>, //"kittens",
|
||||
pub page: Option<FlexibleNumber>, //1,
|
||||
pub page: Option<FlexibleNumber>, //1,
|
||||
pub perPage: Option<FlexibleNumber>, //10,
|
||||
// Your server's global options will be sent in the videos request
|
||||
// pub flavor: "mint chocolate chip"
|
||||
pub featured: Option<String>, // "featured",
|
||||
pub category: Option<String>, // "pmv"
|
||||
pub sites: Option<String>, //
|
||||
pub filter: Option<String>, //
|
||||
pub language: Option<String>, //
|
||||
pub networks: Option<String>, //
|
||||
pub stars: Option<String>, //
|
||||
pub featured: Option<String>, // "featured",
|
||||
pub category: Option<String>, // "pmv"
|
||||
pub sites: Option<String>, //
|
||||
pub all_provider_sites: Option<String>, //
|
||||
pub filter: Option<String>, //
|
||||
pub language: Option<String>, //
|
||||
pub networks: Option<String>, //
|
||||
pub stars: Option<String>, //
|
||||
pub categories: Option<String>,
|
||||
pub duration: Option<String>,
|
||||
}
|
||||
@@ -60,11 +61,11 @@ pub struct ServerOptions {
|
||||
pub filter: Option<String>,
|
||||
pub language: Option<String>, // "en"
|
||||
pub requester: Option<Requester>,
|
||||
pub network: Option<String>, //
|
||||
pub stars: Option<String>, //
|
||||
pub network: Option<String>, //
|
||||
pub stars: Option<String>, //
|
||||
pub categories: Option<String>, //
|
||||
pub duration: Option<String>, //
|
||||
pub sort: Option<String>, //
|
||||
pub duration: Option<String>, //
|
||||
pub sort: Option<String>, //
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, Debug)]
|
||||
@@ -78,11 +79,6 @@ pub struct VideoEmbed {
|
||||
pub html: String,
|
||||
pub source: String,
|
||||
}
|
||||
impl VideoEmbed {
|
||||
pub fn new(html: String, source: String) -> Self {
|
||||
VideoEmbed { html, source }
|
||||
}
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
||||
pub struct VideoItem {
|
||||
pub duration: u32, // 110,
|
||||
@@ -148,7 +144,7 @@ impl VideoItem {
|
||||
serde_json::from_str::<VideoItem>(&s)
|
||||
}
|
||||
pub fn tags(mut self, tags: Vec<String>) -> Self {
|
||||
if tags.is_empty(){
|
||||
if tags.is_empty() {
|
||||
return self;
|
||||
}
|
||||
self.tags = Some(tags);
|
||||
@@ -179,7 +175,7 @@ impl VideoItem {
|
||||
self
|
||||
}
|
||||
pub fn formats(mut self, formats: Vec<VideoFormat>) -> Self {
|
||||
if formats.is_empty(){
|
||||
if formats.is_empty() {
|
||||
return self;
|
||||
}
|
||||
self.formats = Some(formats);
|
||||
|
||||
Reference in New Issue
Block a user