diff --git a/lib/services/weekly_tasks.dart b/lib/services/weekly_tasks.dart index 72b0162..47d4753 100644 --- a/lib/services/weekly_tasks.dart +++ b/lib/services/weekly_tasks.dart @@ -1,12 +1,9 @@ import 'dart:convert'; import 'package:intl/intl.dart'; -import 'package:linux_assistant/enums/softwareManagers.dart'; import 'package:linux_assistant/services/config_handler.dart'; -import 'package:linux_assistant/services/linux.dart'; import 'package:linux_assistant/services/updater.dart'; import 'package:http/http.dart' as http; -import 'dart:io'; class WeeklyTasks { /// Seconds @@ -22,16 +19,7 @@ class WeeklyTasks { } Future newestVersionRunner = _getNewestVersion(); - - Future flathubIndexRunner; - if (Linux.currentenvironment.installedSoftwareManagers - .contains(SOFTWARE_MANAGERS.FLATPAK)) { - flathubIndexRunner = _getFlathubIndex(); - } else { - flathubIndexRunner = Future.delayed(const Duration(seconds: 0)); - } await newestVersionRunner; - await flathubIndexRunner; String newDate = DateFormat('yyyy-MM-dd').format(DateTime.now()); await ConfigHandler().setValue("last-weekly-task", newDate); @@ -49,16 +37,4 @@ class WeeklyTasks { await ConfigHandler() .setValue("newest-linux-assistant-version", newestVersion); } - - static Future _getFlathubIndex() async { - http.Response response = await http - .get(Uri.parse("https://flathub.org/api/v1/apps")) - .timeout(const Duration(seconds: _defaultTimeout)); - - // Write flathubIndexJson into file - String homeDir = Linux.getHomeDirectory(); - File flathubIndexFile = - File("$homeDir.config/linux-assistant/flathub_index.json"); - await flathubIndexFile.writeAsString(response.body); - } }