From 1140d1c031b84afc7adaf05df2683708b86bcf32 Mon Sep 17 00:00:00 2001 From: Frederik Feichtmeier Date: Fri, 2 Aug 2024 20:28:45 +0200 Subject: [PATCH] fix: disable read/write of local cache until setting and dialog are back (#822) * fix: disable read/write of local cache until setting and dialog are back * fix: local sidebar icon --- lib/local_audio/local_audio_service.dart | 8 ++++++-- lib/local_audio/view/album_page.dart | 6 +++++- pubspec.yaml | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/local_audio/local_audio_service.dart b/lib/local_audio/local_audio_service.dart index 504aa5f9e..abab72fe2 100644 --- a/lib/local_audio/local_audio_service.dart +++ b/lib/local_audio/local_audio_service.dart @@ -252,7 +252,10 @@ class LocalAudioService { bool forceInit = false, }) async { if (forceInit == false && _audios?.isNotEmpty == true) return; - await CoverStore().read(); + // TODO: Add a dialog for when people have X (too many) music files + // ask them to confirm that for them no local cache is being loaded and saved + // because such a cache will always be to big + if (kDebugMode) await CoverStore().read(); final result = await compute( _readAudiosFromDirectory, directory ?? _settingsService.directory, @@ -267,7 +270,8 @@ class LocalAudioService { } Future dispose() async { - await CoverStore().write(); + // TODO: delete this when the setting is added + if (kDebugMode) await CoverStore().write(); return _audiosController.close(); } } diff --git a/lib/local_audio/view/album_page.dart b/lib/local_audio/view/album_page.dart index cf875d56e..e0804f35c 100644 --- a/lib/local_audio/view/album_page.dart +++ b/lib/local_audio/view/album_page.dart @@ -83,7 +83,11 @@ class AlbumPageSideBarIcon extends StatelessWidget { borderRadius: BorderRadius.circular(5), child: audio == null ? fallBack - : LocalCover(audio: audio!, fallback: fallBack), + : LocalCover( + audio: audio!, + fallback: fallBack, + dimension: sideBarImageSize, + ), ); } } diff --git a/pubspec.yaml b/pubspec.yaml index ffb95fd9d..6b2a40375 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: musicpod description: Ubuntu music, radio and podcast player. -version: 1.5.1 +version: 1.5.2 publish_to: "none"