background loading

This commit is contained in:
Simon
2025-06-15 07:29:39 +00:00
parent 8cd404d6b1
commit c34d6dcc14
6 changed files with 40 additions and 9 deletions

View File

@@ -21,6 +21,8 @@ error_chain! {
}
}
#[derive(Debug, Clone)]
pub struct PerverzijaProvider {
url: String,
}
@@ -31,12 +33,6 @@ impl PerverzijaProvider {
}
}
async fn get(&self, cache:VideoCache, pool:DbPool, page: u8, featured: String) -> Result<Vec<VideoItem>> {
//TODO
// let mut url = Url::parse("https://example.net")?;
// url.query_pairs_mut().append_pair("foo", "bar");
// url.query_pairs_mut().append_pair("key", "dkhdsihdsaiufds");
// url.query_pairs_mut().append_pair("hello", "world");
// println!("{}", url.as_str());
let mut prefix_uri = "".to_string();
if featured == "featured" {
@@ -118,6 +114,9 @@ impl PerverzijaProvider {
}
}
async fn query(&self, cache: VideoCache, pool:DbPool, page: u8, query: &str) -> Result<Vec<VideoItem>> {
let search_string = query.replace(" ", "+");
let mut url = format!(
"{}page/{}/?s={}",