various bugfixes
This commit is contained in:
@@ -3,7 +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::discord::{format_error_chain, send_discord_error_report};
|
||||
use crate::util::requester::Requester;
|
||||
use crate::util::time::parse_time_to_seconds;
|
||||
use crate::videos::{ServerOptions, VideoFormat, VideoItem};
|
||||
@@ -101,7 +101,7 @@ impl PimpbunnyProvider {
|
||||
let stars = Arc::clone(&self.stars);
|
||||
let categories = Arc::clone(&self.categories);
|
||||
|
||||
thread::spawn(move || {
|
||||
thread::spawn(async move || {
|
||||
let rt = match tokio::runtime::Builder::new_current_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
@@ -109,14 +109,15 @@ impl PimpbunnyProvider {
|
||||
Ok(rt) => rt,
|
||||
Err(e) => {
|
||||
eprintln!("tokio runtime failed: {e}");
|
||||
let _ = futures::executor::block_on(send_discord_error_report(
|
||||
&e,
|
||||
send_discord_error_report(
|
||||
e.to_string(),
|
||||
Some(format_error_chain(&e)),
|
||||
Some("Pimpbunny Provider"),
|
||||
Some("Failed to create tokio runtime"),
|
||||
file!(),
|
||||
line!(),
|
||||
module_path!(),
|
||||
));
|
||||
).await;
|
||||
return;
|
||||
}
|
||||
};
|
||||
@@ -125,7 +126,8 @@ impl PimpbunnyProvider {
|
||||
if let Err(e) = Self::load_stars(&url, Arc::clone(&stars)).await {
|
||||
eprintln!("load_stars failed: {e}");
|
||||
send_discord_error_report(
|
||||
&e,
|
||||
e.to_string(),
|
||||
Some(format_error_chain(&e)),
|
||||
Some("Pimpbunny Provider"),
|
||||
Some("Failed to load stars during initial load"),
|
||||
file!(),
|
||||
@@ -136,7 +138,8 @@ impl PimpbunnyProvider {
|
||||
if let Err(e) = Self::load_categories(&url, Arc::clone(&categories)).await {
|
||||
eprintln!("load_categories failed: {e}");
|
||||
send_discord_error_report(
|
||||
&e,
|
||||
e.to_string(),
|
||||
Some(format_error_chain(&e)),
|
||||
Some("Pimpbunny Provider"),
|
||||
Some("Failed to load categories during initial load"),
|
||||
file!(),
|
||||
@@ -529,7 +532,7 @@ impl Provider for PimpbunnyProvider {
|
||||
})
|
||||
}
|
||||
|
||||
fn get_channel(&self, v: ClientVersion) -> Channel {
|
||||
self.build_channel(v)
|
||||
fn get_channel(&self, v: ClientVersion) -> Option<Channel> {
|
||||
Some(self.build_channel(v))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user