This commit is contained in:
otsmr 2025-11-18 23:38:55 +01:00
parent 66fb320355
commit 89e12fe24f
2 changed files with 9 additions and 10 deletions

View file

@ -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;

View file

@ -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: [