mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 07:48:40 +00:00
fix #313
This commit is contained in:
parent
66fb320355
commit
89e12fe24f
2 changed files with 9 additions and 10 deletions
|
|
@ -45,6 +45,9 @@ Map<String, List<String>> defaultAutoDownloadOptions = {
|
|||
};
|
||||
|
||||
Future<bool> isAllowedToDownload(MediaType type) async {
|
||||
if (type == MediaType.audio) {
|
||||
return true; // always download audio files
|
||||
}
|
||||
final connectivityResult = await Connectivity().checkConnectivity();
|
||||
|
||||
final options = gUser.autoDownloadOptions ?? defaultAutoDownloadOptions;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,9 @@ class _DataAndStorageViewState extends State<DataAndStorageView> {
|
|||
ListTile(
|
||||
title: Text(context.lang.settingsStorageDataAutoDownMobile),
|
||||
subtitle: Text(
|
||||
autoDownloadOptions[ConnectivityResult.mobile.name]!.join(', '),
|
||||
autoDownloadOptions[ConnectivityResult.mobile.name]!
|
||||
.where((e) => e != 'audio')
|
||||
.join(', '),
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
),
|
||||
onTap: () async {
|
||||
|
|
@ -117,7 +119,9 @@ class _DataAndStorageViewState extends State<DataAndStorageView> {
|
|||
ListTile(
|
||||
title: Text(context.lang.settingsStorageDataAutoDownWifi),
|
||||
subtitle: Text(
|
||||
autoDownloadOptions[ConnectivityResult.wifi.name]!.join(', '),
|
||||
autoDownloadOptions[ConnectivityResult.wifi.name]!
|
||||
.where((e) => e != 'audio')
|
||||
.join(', '),
|
||||
style: const TextStyle(color: Colors.grey),
|
||||
),
|
||||
onTap: () async {
|
||||
|
|
@ -178,14 +182,6 @@ class _AutoDownloadOptionsDialogState extends State<AutoDownloadOptionsDialog> {
|
|||
await _updateAutoDownloadSetting(DownloadMediaTypes.video, value);
|
||||
},
|
||||
),
|
||||
CheckboxListTile(
|
||||
title: const Text('Audio'),
|
||||
value: autoDownloadOptions[widget.connectionMode.name]!
|
||||
.contains(DownloadMediaTypes.audio.name),
|
||||
onChanged: (bool? value) async {
|
||||
await _updateAutoDownloadSetting(DownloadMediaTypes.audio, value);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
|
|
|
|||
Loading…
Reference in a new issue