use lighty_loaders::types::{version_metadata::Mods, VersionInfo};
use crate::errors::InstallerResult;
use crate::installer::downloader::DownloadTask;
#[cfg(feature = "events")]
use lighty_event::EventBus;
use super::asset_partition;
pub async fn collect_mod_tasks<'a>(
version: &impl VersionInfo,
mods: &'a [Mods],
) -> Vec<DownloadTask<'a>> {
asset_partition::collect(version, mods, "mods", true).await
}
pub async fn download_mods(
tasks: Vec<DownloadTask<'_>>,
#[cfg(feature = "events")] event_bus: Option<&EventBus>,
) -> InstallerResult<()> {
asset_partition::download(
tasks,
"mods",
#[cfg(feature = "events")]
event_bus,
)
.await
}