feat: Refactor download code

This commit is contained in:
Kroese 2024-05-16 22:35:11 +02:00 committed by GitHub
parent c8babc636f
commit 9e1fb816ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -519,7 +519,13 @@ downloadImage() {
if isMido "$version"; then
tried="y"
doMido "$iso" "$version" "$desc" && return 0
if getWindows "$version"; then
echo "MIDO_URL=$MIDO_URL"
exit 33
size=$(getMido "$version" "size")
sum=$(getMido "$version" "sum")
downloadFile "$iso" "$MIDO_URL" "$sum" "$size" "$desc" && return 0
fi
fi
switchEdition "$version"
@ -527,7 +533,7 @@ downloadImage() {
if isESD "$version"; then
if [[ "$tried" != "n" ]]; then
info "Failed to download $desc using Mido, will try a diferent method now..."
info "Failed to download $desc, will try a diferent method now..."
fi
tried="y"