Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unused code #1050

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions lib/compute_isolate.dart

This file was deleted.

3 changes: 0 additions & 3 deletions lib/extensions/country_x.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:podcast_search/podcast_search.dart';

import '../l10n/l10n.dart';
import 'string_x.dart';

extension CountryX on Country {
String localize(AppLocalizations l10n) => switch (this) {
Expand Down Expand Up @@ -262,7 +261,5 @@ extension CountryX on Country {
Country.yemen => l10n.regionYemen,
Country.zambia => l10n.regionZambia,
Country.zimbabwe => l10n.regionZimbabwe,
// ignore: unreachable_switch_case
_ => name.camelToSentence.everyWordCapitalized,
};
}
13 changes: 1 addition & 12 deletions lib/local_audio/local_cover_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ import 'package:path/path.dart' as p;
import 'package:audio_metadata_reader/audio_metadata_reader.dart';
import 'package:collection/collection.dart';

import '../compute_isolate.dart';
import '../constants.dart';
import '../persistence_utils.dart';

class LocalCoverService {
final _propertiesChangedController = StreamController<bool>.broadcast();
Stream<bool> get propertiesChanged => _propertiesChangedController.stream;

var _store = <String, Uint8List?>{};
final _store = <String, Uint8List?>{};
int get storeLength => _store.length;

Future<Uint8List?> getCover({
Expand Down Expand Up @@ -66,12 +62,5 @@ class LocalCoverService {

Uint8List? get(String? albumId) => albumId == null ? null : _store[albumId];

Future<void> write() async => writeUint8ListMap(_store, kCoverStore);

// This does not make much sense except for small libs, where the store is filled
// fast anyways. Let's keep it for eventual use...
Future<void> read() async =>
_store = await computeIsolate(() => readUint8ListMap(kCoverStore)) ?? [];

Future<void> dispose() async => _propertiesChangedController.close();
}
1 change: 0 additions & 1 deletion lib/settings/settings_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class SettingsService {
void setEnableDiscordRPC(bool value) =>
_preferences.setBool(kEnableDiscordRPC, value).then(notify);

// TODO: check how this increases cpu usage
bool get useMoreAnimations =>
_preferences.getBool(kUseMoreAnimations) ?? !Platform.isLinux;
void setUseMoreAnimations(bool value) =>
Expand Down