use crate::models::queue::QueueItemInfo;
use std::sync::Arc;
pub trait DownloadReporter: Send + Sync + 'static {
fn on_progress(&self, download_id: u64, progress: crate::core::events::QueueItemProgress);
fn on_complete(
&self,
download_id: u64,
file_path: Option<String>,
file_size_bytes: Option<u64>,
);
fn on_error(&self, download_id: u64, error_message: String);
fn on_retry(&self, download_id: u64, attempt: u32, delay_ms: u64);
fn on_phase_change(&self, download_id: u64, phase: String);
fn on_media_preview(
&self,
url: String,
title: String,
author: String,
thumbnail_url: Option<String>,
duration_seconds: Option<f64>,
);
fn on_queue_update(&self, state: Vec<QueueItemInfo>);
fn on_system_progress(&self, title: &str, percent: f32, message: &str);
}
pub type SharedReporter = Arc<dyn DownloadReporter>;