Skip to content

Commit ef1fd01

Browse files
author
Jean 28518
committed
Remove old flatpak api call
1 parent 6d4a058 commit ef1fd01

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

lib/services/weekly_tasks.dart

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import 'dart:convert';
22

33
import 'package:intl/intl.dart';
4-
import 'package:linux_assistant/enums/softwareManagers.dart';
54
import 'package:linux_assistant/services/config_handler.dart';
6-
import 'package:linux_assistant/services/linux.dart';
75
import 'package:linux_assistant/services/updater.dart';
86
import 'package:http/http.dart' as http;
9-
import 'dart:io';
107

118
class WeeklyTasks {
129
/// Seconds
@@ -22,16 +19,7 @@ class WeeklyTasks {
2219
}
2320

2421
Future newestVersionRunner = _getNewestVersion();
25-
26-
Future flathubIndexRunner;
27-
if (Linux.currentenvironment.installedSoftwareManagers
28-
.contains(SOFTWARE_MANAGERS.FLATPAK)) {
29-
flathubIndexRunner = _getFlathubIndex();
30-
} else {
31-
flathubIndexRunner = Future.delayed(const Duration(seconds: 0));
32-
}
3322
await newestVersionRunner;
34-
await flathubIndexRunner;
3523

3624
String newDate = DateFormat('yyyy-MM-dd').format(DateTime.now());
3725
await ConfigHandler().setValue("last-weekly-task", newDate);
@@ -49,16 +37,4 @@ class WeeklyTasks {
4937
await ConfigHandler()
5038
.setValue("newest-linux-assistant-version", newestVersion);
5139
}
52-
53-
static Future<void> _getFlathubIndex() async {
54-
http.Response response = await http
55-
.get(Uri.parse("https://flathub.org/api/v1/apps"))
56-
.timeout(const Duration(seconds: _defaultTimeout));
57-
58-
// Write flathubIndexJson into file
59-
String homeDir = Linux.getHomeDirectory();
60-
File flathubIndexFile =
61-
File("$homeDir.config/linux-assistant/flathub_index.json");
62-
await flathubIndexFile.writeAsString(response.body);
63-
}
6440
}

0 commit comments

Comments
 (0)