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,
filename: String,
hashes: VersionHashes,
// primary: bool,
primary: bool,
// size: i64,
url: String,
}
@ -177,6 +177,7 @@ impl Modrinth {
source: package
.files
.iter()
.filter(|f| f.primary)
.map(|f| FileSource::Download {
url: f.url.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::Server && m.1.server_side
}) {
if let Some(filesource) = pinned_mod.source.first() {
for filesource in pinned_mod.source.iter() {
match filesource {
crate::providers::FileSource::Download {
url,