From 87c4e34f16555c70d590a56b522366599209b991 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Tue, 22 Oct 2024 16:55:25 -0400 Subject: Update album art reading Changes: - Remove escaping of filename in readpicture call to dart-mpd's MpdClient. Upstream changed the API so that it is no longer required. - Refresh pubspec.lock for the new Flutter SDK version, as that had not previously been checked in. Bug-AGL: SPEC-5269 Change-Id: Ied2947b852bea940ee74be517b835ef12d11280d Signed-off-by: Scott Murray --- lib/data/data_providers/mpd_client.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/data/data_providers/mpd_client.dart b/lib/data/data_providers/mpd_client.dart index 98d8918..daafab6 100644 --- a/lib/data/data_providers/mpd_client.dart +++ b/lib/data/data_providers/mpd_client.dart @@ -266,14 +266,17 @@ class MpdClient { artState[position] = ArtStateEntry(reading: true, read: false); } debugPrint("Reading art for \"$file\""); - // Work around dart_mpd not escaping spaced strings itself - String escapedFile = file.replaceAll(RegExp(r" "), "\\ "); - escapedFile = "\"$file\""; bool first = true; do { //debugPrint("Reading, offset = $offset, size = $size"); - var chunk = await client.readpicture(escapedFile, offset); + api.MpdImage? chunk = null; + try { + chunk = await client.readpicture(file, offset); + } catch (e) { + debugPrint(e.toString()); + chunk = null; + } if (chunk != null) { if (chunk.size != null) { if (chunk.size == 0) { -- cgit 1.2.3-korg