mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-01 05:10:15 +02:00
little
This commit is contained in:
@@ -194,31 +194,6 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
}
|
||||
});
|
||||
|
||||
/*var intervalDropdown = DropdownButtonFormField(
|
||||
decoration: InputDecoration(labelText: tr('bgUpdateCheckInterval')),
|
||||
value: settingsProvider.updateInterval,
|
||||
items: updateIntervals.map((e) {
|
||||
int displayNum = (e < 60
|
||||
? e
|
||||
: e < 1440
|
||||
? e / 60
|
||||
: e / 1440)
|
||||
.round();
|
||||
String display = e == 0
|
||||
? tr('neverManualOnly')
|
||||
: (e < 60
|
||||
? plural('minute', displayNum)
|
||||
: e < 1440
|
||||
? plural('hour', displayNum)
|
||||
: plural('day', displayNum));
|
||||
return DropdownMenuItem(value: e, child: Text(display));
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
settingsProvider.updateInterval = value;
|
||||
}
|
||||
});*/
|
||||
|
||||
var intervalSlider = Slider(
|
||||
value: settingsProvider.updateIntervalSliderVal,
|
||||
max: updateIntervalNodes.length.toDouble(),
|
||||
|
@@ -1708,7 +1708,7 @@ Future<void> bgUpdateCheck(String taskId, Map<String, dynamic>? params) async {
|
||||
int maxRetryWaitSeconds = 5;
|
||||
|
||||
var netResult = await (Connectivity().checkConnectivity());
|
||||
if (netResult == ConnectivityResult.none) {
|
||||
if (netResult.contains(ConnectivityResult.none)) {
|
||||
logs.add('BG update task: No network.');
|
||||
return;
|
||||
}
|
||||
@@ -1745,8 +1745,8 @@ Future<void> bgUpdateCheck(String taskId, Map<String, dynamic>? params) async {
|
||||
|
||||
var networkRestricted = false;
|
||||
if (appsProvider.settingsProvider.bgUpdatesOnWiFiOnly) {
|
||||
networkRestricted = (netResult != ConnectivityResult.wifi) &&
|
||||
(netResult != ConnectivityResult.ethernet);
|
||||
networkRestricted = !netResult.contains(ConnectivityResult.wifi) &&
|
||||
!netResult.contains(ConnectivityResult.ethernet);
|
||||
}
|
||||
|
||||
if (toCheck.isNotEmpty) {
|
||||
@@ -1790,8 +1790,8 @@ Future<void> bgUpdateCheck(String taskId, Map<String, dynamic>? params) async {
|
||||
var networkRestricted = false;
|
||||
if (appsProvider.settingsProvider.bgUpdatesOnWiFiOnly) {
|
||||
var netResult = await (Connectivity().checkConnectivity());
|
||||
networkRestricted = (netResult != ConnectivityResult.wifi) &&
|
||||
(netResult != ConnectivityResult.ethernet);
|
||||
networkRestricted = !netResult.contains(ConnectivityResult.wifi) &&
|
||||
!netResult.contains(ConnectivityResult.ethernet);
|
||||
}
|
||||
|
||||
try {
|
||||
|
@@ -26,9 +26,6 @@ enum SortColumnSettings { added, nameAuthor, authorName, releaseDate }
|
||||
|
||||
enum SortOrderSettings { ascending, descending }
|
||||
|
||||
const maxAPIRateLimitMinutes = 30;
|
||||
const minUpdateIntervalMinutes = maxAPIRateLimitMinutes + 30;
|
||||
|
||||
class SettingsProvider with ChangeNotifier {
|
||||
SharedPreferences? prefs;
|
||||
String? defaultAppDir;
|
||||
|
Reference in New Issue
Block a user