2020-06-23 19:23:12 +00: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 17:36:41 +00:00
|
|
|
..language = json['language'] as String
|
2020-10-19 19:28:45 +00:00
|
|
|
..ignoreInterruptions = json['ignoreInterruptions'] as bool ?? false
|
2021-02-09 20:14:14 +00:00
|
|
|
..enableEqualizer = json['enableEqualizer'] as bool ?? false
|
2020-06-23 19:23:12 +00: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 14:41:15 +00:00
|
|
|
..downloadFilename =
|
2020-12-04 17:02:50 +00:00
|
|
|
json['downloadFilename'] as String ?? '%artist% - %title%'
|
2020-09-01 14:41:15 +00:00
|
|
|
..albumFolder = json['albumFolder'] as bool ?? true
|
|
|
|
..artistFolder = json['artistFolder'] as bool ?? true
|
|
|
|
..albumDiscFolder = json['albumDiscFolder'] as bool ?? false
|
2020-09-13 14:06:12 +00:00
|
|
|
..overwriteDownload = json['overwriteDownload'] as bool ?? false
|
2020-10-09 18:52:45 +00:00
|
|
|
..downloadThreads = json['downloadThreads'] as int ?? 2
|
|
|
|
..playlistFolder = json['playlistFolder'] as bool ?? false
|
|
|
|
..downloadLyrics = json['downloadLyrics'] as bool ?? true
|
2020-10-10 20:51:20 +00:00
|
|
|
..trackCover = json['trackCover'] as bool ?? false
|
2020-10-14 19:09:16 +00:00
|
|
|
..albumCover = json['albumCover'] as bool ?? true
|
2020-10-15 18:37:36 +00:00
|
|
|
..nomediaFiles = json['nomediaFiles'] as bool ?? false
|
2020-12-04 17:02:50 +00:00
|
|
|
..artistSeparator = json['artistSeparator'] as String ?? ', '
|
|
|
|
..singletonFilename =
|
|
|
|
json['singletonFilename'] as String ?? '%artist% - %title%'
|
2020-12-14 17:29:28 +00:00
|
|
|
..albumArtResolution = json['albumArtResolution'] as int ?? 1400
|
2021-02-09 20:14:14 +00:00
|
|
|
..tags = (json['tags'] as List)?.map((e) => e as String)?.toList() ??
|
|
|
|
[
|
|
|
|
'title',
|
|
|
|
'album',
|
|
|
|
'artist',
|
|
|
|
'track',
|
|
|
|
'disc',
|
|
|
|
'albumArtist',
|
|
|
|
'date',
|
|
|
|
'label',
|
|
|
|
'isrc',
|
|
|
|
'upc',
|
|
|
|
'trackTotal',
|
|
|
|
'bpm',
|
|
|
|
'lyrics',
|
|
|
|
'genre',
|
|
|
|
'contributors',
|
|
|
|
'art'
|
|
|
|
]
|
2020-06-23 19:23:12 +00:00
|
|
|
..theme =
|
2020-10-11 20:06:29 +00:00
|
|
|
_$enumDecodeNullable(_$ThemesEnumMap, json['theme']) ?? Themes.Dark
|
|
|
|
..useSystemTheme = json['useSystemTheme'] as bool ?? false
|
2020-11-09 21:05:47 +00:00
|
|
|
..colorGradientBackground = json['colorGradientBackground'] as bool ?? true
|
2021-02-09 20:14:14 +00:00
|
|
|
..blurPlayerBackground = json['blurPlayerBackground'] as bool ?? false
|
|
|
|
..font = json['font'] as String ?? 'Deezer'
|
|
|
|
..lyricsVisualizer = json['lyricsVisualizer'] as bool ?? false
|
2021-03-21 21:46:44 +00:00
|
|
|
..displayMode = json['displayMode'] as int
|
2020-06-23 19:23:12 +00: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 18:52:45 +00:00
|
|
|
..logListen = json['logListen'] as bool ?? false
|
2020-11-09 21:05:47 +00:00
|
|
|
..proxyAddress = json['proxyAddress'] as String
|
|
|
|
..lastFMUsername = json['lastFMUsername'] as String
|
2021-04-05 20:22:32 +00:00
|
|
|
..lastFMPassword = json['lastFMPassword'] as String
|
|
|
|
..spotifyClientId = json['spotifyClientId'] as String
|
2021-04-06 07:57:38 +00:00
|
|
|
..spotifyClientSecret = json['spotifyClientSecret'] as String
|
|
|
|
..spotifyCredentials = json['spotifyCredentials'] == null
|
|
|
|
? null
|
|
|
|
: SpotifyCredentialsSave.fromJson(
|
|
|
|
json['spotifyCredentials'] as Map<String, dynamic>);
|
2020-06-23 19:23:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> _$SettingsToJson(Settings instance) => <String, dynamic>{
|
2020-09-18 17:36:41 +00:00
|
|
|
'language': instance.language,
|
2020-10-19 19:28:45 +00:00
|
|
|
'ignoreInterruptions': instance.ignoreInterruptions,
|
2021-02-09 20:14:14 +00:00
|
|
|
'enableEqualizer': instance.enableEqualizer,
|
2020-06-23 19:23:12 +00: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 14:41:15 +00:00
|
|
|
'downloadFilename': instance.downloadFilename,
|
|
|
|
'albumFolder': instance.albumFolder,
|
|
|
|
'artistFolder': instance.artistFolder,
|
|
|
|
'albumDiscFolder': instance.albumDiscFolder,
|
2020-09-13 14:06:12 +00:00
|
|
|
'overwriteDownload': instance.overwriteDownload,
|
2020-10-09 18:52:45 +00:00
|
|
|
'downloadThreads': instance.downloadThreads,
|
|
|
|
'playlistFolder': instance.playlistFolder,
|
|
|
|
'downloadLyrics': instance.downloadLyrics,
|
2020-10-10 20:51:20 +00:00
|
|
|
'trackCover': instance.trackCover,
|
2020-10-14 19:09:16 +00:00
|
|
|
'albumCover': instance.albumCover,
|
2020-10-15 18:37:36 +00:00
|
|
|
'nomediaFiles': instance.nomediaFiles,
|
2020-12-04 17:02:50 +00:00
|
|
|
'artistSeparator': instance.artistSeparator,
|
|
|
|
'singletonFilename': instance.singletonFilename,
|
2020-12-14 17:29:28 +00:00
|
|
|
'albumArtResolution': instance.albumArtResolution,
|
2021-02-09 20:14:14 +00:00
|
|
|
'tags': instance.tags,
|
2020-06-23 19:23:12 +00:00
|
|
|
'theme': _$ThemesEnumMap[instance.theme],
|
2020-10-11 20:06:29 +00:00
|
|
|
'useSystemTheme': instance.useSystemTheme,
|
2020-11-09 21:05:47 +00:00
|
|
|
'colorGradientBackground': instance.colorGradientBackground,
|
2021-02-09 20:14:14 +00:00
|
|
|
'blurPlayerBackground': instance.blurPlayerBackground,
|
|
|
|
'font': instance.font,
|
|
|
|
'lyricsVisualizer': instance.lyricsVisualizer,
|
2021-03-21 21:46:44 +00:00
|
|
|
'displayMode': instance.displayMode,
|
2020-06-23 19:23:12 +00:00
|
|
|
'primaryColor': Settings._colorToJson(instance.primaryColor),
|
|
|
|
'useArtColor': instance.useArtColor,
|
|
|
|
'deezerLanguage': instance.deezerLanguage,
|
|
|
|
'deezerCountry': instance.deezerCountry,
|
|
|
|
'logListen': instance.logListen,
|
2020-10-09 18:52:45 +00:00
|
|
|
'proxyAddress': instance.proxyAddress,
|
2020-11-09 21:05:47 +00:00
|
|
|
'lastFMUsername': instance.lastFMUsername,
|
|
|
|
'lastFMPassword': instance.lastFMPassword,
|
2021-04-05 20:22:32 +00:00
|
|
|
'spotifyClientId': instance.spotifyClientId,
|
|
|
|
'spotifyClientSecret': instance.spotifyClientSecret,
|
2021-04-06 07:57:38 +00:00
|
|
|
'spotifyCredentials': instance.spotifyCredentials,
|
2020-06-23 19:23:12 +00: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',
|
2020-10-19 19:28:45 +00:00
|
|
|
AudioQuality.ASK: 'ASK',
|
2020-06-23 19:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const _$ThemesEnumMap = {
|
|
|
|
Themes.Light: 'Light',
|
|
|
|
Themes.Dark: 'Dark',
|
2020-07-18 21:45:48 +00:00
|
|
|
Themes.Deezer: 'Deezer',
|
2020-06-23 19:23:12 +00:00
|
|
|
Themes.Black: 'Black',
|
|
|
|
};
|
2021-04-06 07:57:38 +00:00
|
|
|
|
|
|
|
SpotifyCredentialsSave _$SpotifyCredentialsSaveFromJson(
|
|
|
|
Map<String, dynamic> json) {
|
|
|
|
return SpotifyCredentialsSave(
|
|
|
|
accessToken: json['accessToken'] as String,
|
|
|
|
refreshToken: json['refreshToken'] as String,
|
|
|
|
scopes: (json['scopes'] as List)?.map((e) => e as String)?.toList(),
|
|
|
|
expiration: json['expiration'] == null
|
|
|
|
? null
|
|
|
|
: DateTime.parse(json['expiration'] as String),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> _$SpotifyCredentialsSaveToJson(
|
|
|
|
SpotifyCredentialsSave instance) =>
|
|
|
|
<String, dynamic>{
|
|
|
|
'accessToken': instance.accessToken,
|
|
|
|
'refreshToken': instance.refreshToken,
|
|
|
|
'scopes': instance.scopes,
|
|
|
|
'expiration': instance.expiration?.toIso8601String(),
|
|
|
|
};
|