bugfixes
This commit is contained in:
@@ -3,6 +3,7 @@ use crate::api::ClientVersion;
|
|||||||
use crate::providers::Provider;
|
use crate::providers::Provider;
|
||||||
use crate::status::*;
|
use crate::status::*;
|
||||||
use crate::util::cache::VideoCache;
|
use crate::util::cache::VideoCache;
|
||||||
|
use crate::util::discord::send_discord_error_report;
|
||||||
use crate::util::time::parse_time_to_seconds;
|
use crate::util::time::parse_time_to_seconds;
|
||||||
use crate::videos::{ServerOptions, VideoItem};
|
use crate::videos::{ServerOptions, VideoItem};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
@@ -182,11 +183,7 @@ impl PmvhavenProvider {
|
|||||||
if !search.is_empty() {
|
if !search.is_empty() {
|
||||||
url.push_str(&format!("&q={search}"));
|
url.push_str(&format!("&q={search}"));
|
||||||
}
|
}
|
||||||
println!("pmvhaven query url: {}", url);
|
|
||||||
if let Some((time, items)) = cache.get(&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 {
|
if time.elapsed().unwrap_or_default().as_secs() < 300 {
|
||||||
return Ok(items.clone());
|
return Ok(items.clone());
|
||||||
}
|
}
|
||||||
@@ -280,6 +277,14 @@ impl Provider for PmvhavenProvider {
|
|||||||
Ok(v) => v,
|
Ok(v) => v,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("pmvhaven error: {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![]
|
vec![]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ impl SxyprnProvider {
|
|||||||
.and_then(|s| s.split('\'').next())
|
.and_then(|s| s.split('\'').next())
|
||||||
.map(|u| u.to_string())
|
.map(|u| u.to_string())
|
||||||
})
|
})
|
||||||
.filter(|url| url.starts_with("http") || !url.starts_with("https://lulustream."))
|
.filter(|url| url.starts_with("https://lulustream."))
|
||||||
.collect::<Vec<String>>();
|
.collect::<Vec<String>>();
|
||||||
|
|
||||||
let video_item_url = stream_urls.first().cloned().unwrap_or_else(|| {
|
let video_item_url = stream_urls.first().cloned().unwrap_or_else(|| {
|
||||||
|
|||||||
Reference in New Issue
Block a user