clean cache, handled warnings etc
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
use crate::{providers::{hanime::HanimeProvider, perverzija::PerverzijaProvider}, util::cache::VideoCache, videos::Video_Item, DbPool};
|
||||
use crate::{providers::{hanime::HanimeProvider, perverzija::PerverzijaProvider}, util::cache::VideoCache, videos::VideoItem, DbPool};
|
||||
|
||||
pub mod perverzija;
|
||||
pub mod hanime;
|
||||
|
||||
pub trait Provider{
|
||||
async fn get_videos(&self, cache: VideoCache, pool: DbPool, channel: String, sort: String, query: Option<String>, page: String, per_page: String, featured: String) -> Vec<Video_Item>;
|
||||
async fn get_videos(&self, cache: VideoCache, pool: DbPool, channel: String, sort: String, query: Option<String>, page: String, per_page: String, featured: String) -> Vec<VideoItem>;
|
||||
}
|
||||
|
||||
pub enum AnyProvider {
|
||||
@@ -12,7 +12,7 @@ pub enum AnyProvider {
|
||||
Hanime(HanimeProvider),
|
||||
}
|
||||
impl Provider for AnyProvider {
|
||||
async fn get_videos(&self, cache: VideoCache, pool:DbPool, channel: String, sort: String, query: Option<String>, page: String, per_page: String, featured: String) -> Vec<Video_Item> {
|
||||
async fn get_videos(&self, cache: VideoCache, pool:DbPool, channel: String, sort: String, query: Option<String>, page: String, per_page: String, featured: String) -> Vec<VideoItem> {
|
||||
match self {
|
||||
AnyProvider::Perverzija(p) => p.get_videos(cache, pool, channel, sort, query, page, per_page, featured).await,
|
||||
AnyProvider::Hanime(p) => p.get_videos(cache, pool, channel, sort, query, page, per_page, featured).await,
|
||||
|
||||
Reference in New Issue
Block a user