Only include primary mod file sources in lockfile for download

This commit is contained in:
Warren Hood 2024-08-20 01:14:45 +02:00
parent 21ddcc1b52
commit 257d24e2e7
2 changed files with 3 additions and 2 deletions

View file

@ -38,7 +38,7 @@ struct VersionFiles {
// file_type: String, // file_type: String,
filename: String, filename: String,
hashes: VersionHashes, hashes: VersionHashes,
// primary: bool, primary: bool,
// size: i64, // size: i64,
url: String, url: String,
} }
@ -177,6 +177,7 @@ impl Modrinth {
source: package source: package
.files .files
.iter() .iter()
.filter(|f| f.primary)
.map(|f| FileSource::Download { .map(|f| FileSource::Download {
url: f.url.clone(), url: f.url.clone(),
sha1: f.hashes.sha1.clone(), sha1: f.hashes.sha1.clone(),

View file

@ -56,7 +56,7 @@ impl PinnedPackMeta {
|| download_side == DownloadSide::Client && m.1.client_side || download_side == DownloadSide::Client && m.1.client_side
|| download_side == DownloadSide::Server && m.1.server_side || download_side == DownloadSide::Server && m.1.server_side
}) { }) {
if let Some(filesource) = pinned_mod.source.first() { for filesource in pinned_mod.source.iter() {
match filesource { match filesource {
crate::providers::FileSource::Download { crate::providers::FileSource::Download {
url, url,