Skip to content

Commit

Permalink
fix: disable read/write of local cache until setting and dialog are b…
Browse files Browse the repository at this point in the history
…ack (#822)

* fix: disable read/write of local cache until setting and dialog are back

* fix: local sidebar icon
  • Loading branch information
Feichtmeier authored Aug 2, 2024
1 parent 5168155 commit 1140d1c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions lib/local_audio/local_audio_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -267,7 +270,8 @@ class LocalAudioService {
}

Future<void> dispose() async {
await CoverStore().write();
// TODO: delete this when the setting is added
if (kDebugMode) await CoverStore().write();
return _audiosController.close();
}
}
Expand Down
6 changes: 5 additions & 1 deletion lib/local_audio/view/album_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: musicpod
description: Ubuntu music, radio and podcast player.
version: 1.5.1
version: 1.5.2

publish_to: "none"

Expand Down

0 comments on commit 1140d1c

Please sign in to comment.