0.6.12 - bug fixes

This commit is contained in:
exttex 2021-07-02 18:28:59 +02:00
parent aa7f82b399
commit 972e84c136
18 changed files with 271 additions and 150 deletions

View file

@ -1,15 +1,11 @@
import 'dart:async';
import 'package:freezer/api/deezer.dart';
import 'package:freezer/api/definitions.dart';
import 'package:freezer/ui/details_screens.dart';
import 'package:freezer/ui/library.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path/path.dart' as p;
import 'dart:io';
import 'dart:convert';
import 'dart:async';
part 'cache.g.dart';
@ -68,6 +64,12 @@ class Cache {
if (searchHistory == null)
searchHistory = [];
// Remove duplicate
int i = searchHistory.indexWhere((e) => e.data.id == item.id);
if (i != -1) {
searchHistory.removeAt(i);
}
if (item is Track)
searchHistory.add(SearchHistoryItem(item, SearchHistoryItemType.TRACK));
if (item is Album)