mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-10-24 19:33:45 +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(
|
var intervalSlider = Slider(
|
||||||
value: settingsProvider.updateIntervalSliderVal,
|
value: settingsProvider.updateIntervalSliderVal,
|
||||||
max: updateIntervalNodes.length.toDouble(),
|
max: updateIntervalNodes.length.toDouble(),
|
||||||
|
|||||||
@@ -1708,7 +1708,7 @@ Future<void> bgUpdateCheck(String taskId, Map<String, dynamic>? params) async {
|
|||||||
int maxRetryWaitSeconds = 5;
|
int maxRetryWaitSeconds = 5;
|
||||||
|
|
||||||
var netResult = await (Connectivity().checkConnectivity());
|
var netResult = await (Connectivity().checkConnectivity());
|
||||||
if (netResult == ConnectivityResult.none) {
|
if (netResult.contains(ConnectivityResult.none)) {
|
||||||
logs.add('BG update task: No network.');
|
logs.add('BG update task: No network.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1745,8 +1745,8 @@ Future<void> bgUpdateCheck(String taskId, Map<String, dynamic>? params) async {
|
|||||||
|
|
||||||
var networkRestricted = false;
|
var networkRestricted = false;
|
||||||
if (appsProvider.settingsProvider.bgUpdatesOnWiFiOnly) {
|
if (appsProvider.settingsProvider.bgUpdatesOnWiFiOnly) {
|
||||||
networkRestricted = (netResult != ConnectivityResult.wifi) &&
|
networkRestricted = !netResult.contains(ConnectivityResult.wifi) &&
|
||||||
(netResult != ConnectivityResult.ethernet);
|
!netResult.contains(ConnectivityResult.ethernet);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toCheck.isNotEmpty) {
|
if (toCheck.isNotEmpty) {
|
||||||
@@ -1790,8 +1790,8 @@ Future<void> bgUpdateCheck(String taskId, Map<String, dynamic>? params) async {
|
|||||||
var networkRestricted = false;
|
var networkRestricted = false;
|
||||||
if (appsProvider.settingsProvider.bgUpdatesOnWiFiOnly) {
|
if (appsProvider.settingsProvider.bgUpdatesOnWiFiOnly) {
|
||||||
var netResult = await (Connectivity().checkConnectivity());
|
var netResult = await (Connectivity().checkConnectivity());
|
||||||
networkRestricted = (netResult != ConnectivityResult.wifi) &&
|
networkRestricted = !netResult.contains(ConnectivityResult.wifi) &&
|
||||||
(netResult != ConnectivityResult.ethernet);
|
!netResult.contains(ConnectivityResult.ethernet);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -26,9 +26,6 @@ enum SortColumnSettings { added, nameAuthor, authorName, releaseDate }
|
|||||||
|
|
||||||
enum SortOrderSettings { ascending, descending }
|
enum SortOrderSettings { ascending, descending }
|
||||||
|
|
||||||
const maxAPIRateLimitMinutes = 30;
|
|
||||||
const minUpdateIntervalMinutes = maxAPIRateLimitMinutes + 30;
|
|
||||||
|
|
||||||
class SettingsProvider with ChangeNotifier {
|
class SettingsProvider with ChangeNotifier {
|
||||||
SharedPreferences? prefs;
|
SharedPreferences? prefs;
|
||||||
String? defaultAppDir;
|
String? defaultAppDir;
|
||||||
|
|||||||
Reference in New Issue
Block a user