summaryrefslogtreecommitdiffstats
path: root/lib/data/data_providers/mpd_client.dart
diff options
context:
space:
mode:
Diffstat (limited to 'lib/data/data_providers/mpd_client.dart')
-rw-r--r--lib/data/data_providers/mpd_client.dart11
1 files changed, 7 insertions, 4 deletions
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) {