2020-06-23 21:23:12 +02:00
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
|
|
|
|
part of 'settings.dart';
|
|
|
|
|
|
|
|
// **************************************************************************
|
|
|
|
// JsonSerializableGenerator
|
|
|
|
// **************************************************************************
|
|
|
|
|
|
|
|
Settings _$SettingsFromJson(Map<String, dynamic> json) {
|
|
|
|
return Settings(
|
|
|
|
downloadPath: json['downloadPath'] as String,
|
|
|
|
arl: json['arl'] as String,
|
|
|
|
)
|
2020-09-18 19:36:41 +02:00
|
|
|
..language = json['language'] as String
|
2020-06-23 21:23:12 +02:00
|
|
|
..wifiQuality =
|
|
|
|
_$enumDecodeNullable(_$AudioQualityEnumMap, json['wifiQuality']) ??
|
|
|
|
AudioQuality.MP3_320
|
|
|
|
..mobileQuality =
|
|
|
|
_$enumDecodeNullable(_$AudioQualityEnumMap, json['mobileQuality']) ??
|
|
|
|
AudioQuality.MP3_128
|
|
|
|
..offlineQuality =
|
|
|
|
_$enumDecodeNullable(_$AudioQualityEnumMap, json['offlineQuality']) ??
|
|
|
|
AudioQuality.FLAC
|
|
|
|
..downloadQuality =
|
|
|
|
_$enumDecodeNullable(_$AudioQualityEnumMap, json['downloadQuality']) ??
|
|
|
|
AudioQuality.FLAC
|
2020-09-01 16:41:15 +02:00
|
|
|
..downloadFilename =
|
|
|
|
json['downloadFilename'] as String ?? '%artists% - %title%'
|
|
|
|
..albumFolder = json['albumFolder'] as bool ?? true
|
|
|
|
..artistFolder = json['artistFolder'] as bool ?? true
|
|
|
|
..albumDiscFolder = json['albumDiscFolder'] as bool ?? false
|
2020-09-13 16:06:12 +02:00
|
|
|
..overwriteDownload = json['overwriteDownload'] as bool ?? false
|
2020-10-09 20:52:45 +02:00
|
|
|
..downloadThreads = json['downloadThreads'] as int ?? 2
|
|
|
|
..playlistFolder = json['playlistFolder'] as bool ?? false
|
|
|
|
..downloadLyrics = json['downloadLyrics'] as bool ?? true
|
2020-10-10 22:51:20 +02:00
|
|
|
..trackCover = json['trackCover'] as bool ?? false
|
2020-10-14 21:09:16 +02:00
|
|
|
..albumCover = json['albumCover'] as bool ?? true
|
2020-10-15 20:37:36 +02:00
|
|
|
..nomediaFiles = json['nomediaFiles'] as bool ?? false
|
2020-06-23 21:23:12 +02:00
|
|
|
..theme =
|
2020-10-11 22:06:29 +02:00
|
|
|
_$enumDecodeNullable(_$ThemesEnumMap, json['theme']) ?? Themes.Dark
|
|
|
|
..useSystemTheme = json['useSystemTheme'] as bool ?? false
|
2020-06-23 21:23:12 +02:00
|
|
|
..primaryColor = Settings._colorFromJson(json['primaryColor'] as int)
|
|
|
|
..useArtColor = json['useArtColor'] as bool ?? false
|
|
|
|
..deezerLanguage = json['deezerLanguage'] as String ?? 'en'
|
|
|
|
..deezerCountry = json['deezerCountry'] as String ?? 'US'
|
2020-10-09 20:52:45 +02:00
|
|
|
..logListen = json['logListen'] as bool ?? false
|
|
|
|
..proxyAddress = json['proxyAddress'] as String;
|
2020-06-23 21:23:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> _$SettingsToJson(Settings instance) => <String, dynamic>{
|
2020-09-18 19:36:41 +02:00
|
|
|
'language': instance.language,
|
2020-06-23 21:23:12 +02:00
|
|
|
'arl': instance.arl,
|
|
|
|
'wifiQuality': _$AudioQualityEnumMap[instance.wifiQuality],
|
|
|
|
'mobileQuality': _$AudioQualityEnumMap[instance.mobileQuality],
|
|
|
|
'offlineQuality': _$AudioQualityEnumMap[instance.offlineQuality],
|
|
|
|
'downloadQuality': _$AudioQualityEnumMap[instance.downloadQuality],
|
|
|
|
'downloadPath': instance.downloadPath,
|
2020-09-01 16:41:15 +02:00
|
|
|
'downloadFilename': instance.downloadFilename,
|
|
|
|
'albumFolder': instance.albumFolder,
|
|
|
|
'artistFolder': instance.artistFolder,
|
|
|
|
'albumDiscFolder': instance.albumDiscFolder,
|
2020-09-13 16:06:12 +02:00
|
|
|
'overwriteDownload': instance.overwriteDownload,
|
2020-10-09 20:52:45 +02:00
|
|
|
'downloadThreads': instance.downloadThreads,
|
|
|
|
'playlistFolder': instance.playlistFolder,
|
|
|
|
'downloadLyrics': instance.downloadLyrics,
|
2020-10-10 22:51:20 +02:00
|
|
|
'trackCover': instance.trackCover,
|
2020-10-14 21:09:16 +02:00
|
|
|
'albumCover': instance.albumCover,
|
2020-10-15 20:37:36 +02:00
|
|
|
'nomediaFiles': instance.nomediaFiles,
|
2020-06-23 21:23:12 +02:00
|
|
|
'theme': _$ThemesEnumMap[instance.theme],
|
2020-10-11 22:06:29 +02:00
|
|
|
'useSystemTheme': instance.useSystemTheme,
|
2020-06-23 21:23:12 +02:00
|
|
|
'primaryColor': Settings._colorToJson(instance.primaryColor),
|
|
|
|
'useArtColor': instance.useArtColor,
|
|
|
|
'deezerLanguage': instance.deezerLanguage,
|
|
|
|
'deezerCountry': instance.deezerCountry,
|
|
|
|
'logListen': instance.logListen,
|
2020-10-09 20:52:45 +02:00
|
|
|
'proxyAddress': instance.proxyAddress,
|
2020-06-23 21:23:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
T _$enumDecode<T>(
|
|
|
|
Map<T, dynamic> enumValues,
|
|
|
|
dynamic source, {
|
|
|
|
T unknownValue,
|
|
|
|
}) {
|
|
|
|
if (source == null) {
|
|
|
|
throw ArgumentError('A value must be provided. Supported values: '
|
|
|
|
'${enumValues.values.join(', ')}');
|
|
|
|
}
|
|
|
|
|
|
|
|
final value = enumValues.entries
|
|
|
|
.singleWhere((e) => e.value == source, orElse: () => null)
|
|
|
|
?.key;
|
|
|
|
|
|
|
|
if (value == null && unknownValue == null) {
|
|
|
|
throw ArgumentError('`$source` is not one of the supported values: '
|
|
|
|
'${enumValues.values.join(', ')}');
|
|
|
|
}
|
|
|
|
return value ?? unknownValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
T _$enumDecodeNullable<T>(
|
|
|
|
Map<T, dynamic> enumValues,
|
|
|
|
dynamic source, {
|
|
|
|
T unknownValue,
|
|
|
|
}) {
|
|
|
|
if (source == null) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return _$enumDecode<T>(enumValues, source, unknownValue: unknownValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
const _$AudioQualityEnumMap = {
|
|
|
|
AudioQuality.MP3_128: 'MP3_128',
|
|
|
|
AudioQuality.MP3_320: 'MP3_320',
|
|
|
|
AudioQuality.FLAC: 'FLAC',
|
|
|
|
};
|
|
|
|
|
|
|
|
const _$ThemesEnumMap = {
|
|
|
|
Themes.Light: 'Light',
|
|
|
|
Themes.Dark: 'Dark',
|
2020-07-18 23:45:48 +02:00
|
|
|
Themes.Deezer: 'Deezer',
|
2020-06-23 21:23:12 +02:00
|
|
|
Themes.Black: 'Black',
|
|
|
|
};
|