0.6.1 - UI Fixes

This commit is contained in:
exttex 2020-10-20 21:55:14 +02:00
parent 1384aedb35
commit df3b7d3d63
16 changed files with 215 additions and 34 deletions

View file

@ -32,7 +32,7 @@ Cache _$CacheFromJson(Map<String, dynamic> json) {
..trackSort = _$enumDecodeNullable(_$SortTypeEnumMap, json['trackSort']) ??
SortType.DEFAULT
..searchHistory =
(json['searchHistory'] as List)?.map((e) => e as String)?.toList() ?? []
Cache._searchHistoryFromJson(json['searchHistory2'] as List)
..threadsWarning = json['threadsWarning'] as bool ?? false;
}
@ -46,7 +46,7 @@ Map<String, dynamic> _$CacheToJson(Cache instance) => <String, dynamic>{
'libraryPlaylistSort':
_$PlaylistSortTypeEnumMap[instance.libraryPlaylistSort],
'trackSort': _$SortTypeEnumMap[instance.trackSort],
'searchHistory': instance.searchHistory,
'searchHistory2': Cache._searchHistoryToJson(instance.searchHistory),
'threadsWarning': instance.threadsWarning,
};
@ -110,3 +110,23 @@ const _$PlaylistSortTypeEnumMap = {
PlaylistSortType.USER: 'USER',
PlaylistSortType.TRACK_COUNT: 'TRACK_COUNT',
};
SearchHistoryItem _$SearchHistoryItemFromJson(Map<String, dynamic> json) {
return SearchHistoryItem(
json['data'],
_$enumDecodeNullable(_$SearchHistoryItemTypeEnumMap, json['type']),
);
}
Map<String, dynamic> _$SearchHistoryItemToJson(SearchHistoryItem instance) =>
<String, dynamic>{
'data': instance.data,
'type': _$SearchHistoryItemTypeEnumMap[instance.type],
};
const _$SearchHistoryItemTypeEnumMap = {
SearchHistoryItemType.TRACK: 'TRACK',
SearchHistoryItemType.ALBUM: 'ALBUM',
SearchHistoryItemType.ARTIST: 'ARTIST',
SearchHistoryItemType.PLAYLIST: 'PLAYLIST',
};