bugfixes
This commit is contained in:
@@ -3,6 +3,7 @@ use crate::api::ClientVersion;
|
||||
use crate::providers::Provider;
|
||||
use crate::status::*;
|
||||
use crate::util::cache::VideoCache;
|
||||
use crate::util::discord::send_discord_error_report;
|
||||
use crate::util::time::parse_time_to_seconds;
|
||||
use crate::videos::{ServerOptions, VideoItem};
|
||||
use async_trait::async_trait;
|
||||
@@ -182,11 +183,7 @@ impl PmvhavenProvider {
|
||||
if !search.is_empty() {
|
||||
url.push_str(&format!("&q={search}"));
|
||||
}
|
||||
println!("pmvhaven query url: {}", url);
|
||||
if let Some((time, items)) = cache.get(&url) {
|
||||
println!("pmvhaven cache hit for url: {}", url);
|
||||
println!("cache age: {} secs", time.elapsed().unwrap_or_default().as_secs());
|
||||
println!("cached items: {}", items.len());
|
||||
if time.elapsed().unwrap_or_default().as_secs() < 300 {
|
||||
return Ok(items.clone());
|
||||
}
|
||||
@@ -280,6 +277,14 @@ impl Provider for PmvhavenProvider {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
eprintln!("pmvhaven error: {e}");
|
||||
let _ = futures::executor::block_on(send_discord_error_report(
|
||||
&e,
|
||||
Some("PMVHaven Provider"),
|
||||
Some("Failed to load videos from PMVHaven"),
|
||||
file!(),
|
||||
line!(),
|
||||
module_path!(),
|
||||
));
|
||||
vec![]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user