provider refactors and fixes
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use crate::api::ClientVersion;
|
||||
use crate::DbPool;
|
||||
use crate::providers::Provider;
|
||||
use crate::status::*;
|
||||
use crate::util::cache::VideoCache;
|
||||
use crate::util::discord::{format_error_chain, send_discord_error_report};
|
||||
use crate::util::time::parse_time_to_seconds;
|
||||
@@ -28,6 +30,50 @@ impl PornzogProvider {
|
||||
}
|
||||
}
|
||||
|
||||
fn build_channel(&self, _clientversion: ClientVersion) -> Channel {
|
||||
Channel {
|
||||
id: "pornzog".to_string(),
|
||||
name: "Pornzog".to_string(),
|
||||
description: "Watch free porn videos at PornZog Free Porn Clips. More than 1 million videos, watch for free now!".to_string(),
|
||||
premium: false,
|
||||
favicon: "https://www.google.com/s2/favicons?sz=64&domain=pornzog.com".to_string(),
|
||||
status: "active".to_string(),
|
||||
categories: vec![],
|
||||
options: vec![ChannelOption {
|
||||
id: "sort".to_string(),
|
||||
title: "Sort".to_string(),
|
||||
description: "Sort the Videos".to_string(),
|
||||
systemImage: "list.number".to_string(),
|
||||
colorName: "blue".to_string(),
|
||||
options: vec![
|
||||
FilterOption {
|
||||
id: "recent".to_string(),
|
||||
title: "Recent".to_string(),
|
||||
},
|
||||
FilterOption {
|
||||
id: "relevance".to_string(),
|
||||
title: "Relevance".to_string(),
|
||||
},
|
||||
FilterOption {
|
||||
id: "viewed".to_string(),
|
||||
title: "Most Viewed".to_string(),
|
||||
},
|
||||
FilterOption {
|
||||
id: "rated".to_string(),
|
||||
title: "Most Rated".to_string(),
|
||||
},
|
||||
FilterOption {
|
||||
id: "longest".to_string(),
|
||||
title: "Longest".to_string(),
|
||||
},
|
||||
],
|
||||
multiSelect: false,
|
||||
}],
|
||||
nsfw: true,
|
||||
cacheDuration: None,
|
||||
}
|
||||
}
|
||||
|
||||
async fn query(
|
||||
&self,
|
||||
cache: VideoCache,
|
||||
@@ -206,4 +252,8 @@ impl Provider for PornzogProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn get_channel(&self, clientversion: ClientVersion) -> Option<Channel> {
|
||||
Some(self.build_channel(clientversion))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user