Support for the "downloader" field from `quickget list_csv`

This commit is contained in:
Yannick Mauray 2021-10-27 18:04:55 +02:00
parent 4a289fe238
commit 0a2fe5b032
No known key found for this signature in database
GPG Key ID: 67C4AAC5E99CB909
1 changed files with 9 additions and 1 deletions

View File

@ -26,7 +26,15 @@ Future<List<OperatingSystem>> loadOperatingSystems(bool showUbuntus) async {
Version? currentVersion;
stdout.split('\n').skip(1).where((element) => element.isNotEmpty).map((e) => e.trim()).forEach((element) {
var supportedVersion = Tuple4.fromList(element.split(","));
var chunks = element.split(",");
Tuple5 supportedVersion;
if (chunks.length == 4) // Legacy version of quickget
{
supportedVersion = Tuple5.fromList([...chunks, "wget"]);
} else {
supportedVersion = Tuple5.fromList(chunks);
}
if (currentOperatingSystem?.code != supportedVersion.item2) {
currentOperatingSystem = OperatingSystem(supportedVersion.item1, supportedVersion.item2);
output.add(currentOperatingSystem!);