Skip to content

Commit 6289adf

Browse files
committed
1.0.5
1 parent 2256a51 commit 6289adf

File tree

7 files changed

+77
-29
lines changed

7 files changed

+77
-29
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.0.5
2+
3+
- Fixed crash when album art couldn't be loaded on Android 10+
4+
- Fixed that new playlist action in playlists tab could be tapped in selection
5+
16
## 1.0.4
27

38
- Added playlists and artists

android/app/src/main/java/com/nt4f04und/sweyer/channels/ContentChannel.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public void onMethodCall(MethodCall call, @NotNull MethodChannel.Result result)
8888
loadingSignals.put(id, signal);
8989
Executors.newSingleThreadExecutor().execute(() -> {
9090
byte[] bytes = null;
91+
boolean reported = false;
9192
try {
9293
Bitmap bitmap = contentResolver.loadThumbnail(
9394
Uri.parse(call.argument("uri")),
@@ -100,13 +101,18 @@ public void onMethodCall(MethodCall call, @NotNull MethodChannel.Result result)
100101
} catch (OperationCanceledException ex) {
101102
// do nothing
102103
} catch (IOException e) {
103-
result.error(IO_ERROR, "loadThumbnail failed", Log.getStackTraceString(e));
104-
} finally {
105-
byte[] finalBytes = bytes;
104+
reported = true;
106105
handler.post(() -> {
107-
loadingSignals.remove(id);
108-
result.success(finalBytes);
106+
result.error(IO_ERROR, "loadThumbnail failed", Log.getStackTraceString(e));
109107
});
108+
} finally {
109+
if (!reported) {
110+
byte[] finalBytes = bytes;
111+
handler.post(() -> {
112+
loadingSignals.remove(id);
113+
result.success(finalBytes);
114+
});
115+
}
110116
}
111117
});
112118
} else {
@@ -277,7 +283,6 @@ public void onMethodCall(MethodCall call, @NotNull MethodChannel.Result result)
277283
handler.post(() -> {
278284
result.error(UNEXPECTED_ERROR, e.getMessage(), Log.getStackTraceString(e));
279285
});
280-
281286
}
282287
});
283288
break;

lib/routes/home_route/tabs_route.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ class _ContentTabState extends State<_ContentTab> with AutomaticKeepAliveClientM
527527
),
528528
),
529529
if (contentType == Playlist && !selectionRoute)
530-
const CreatePlaylistInListAction(),
530+
CreatePlaylistInListAction(enabled: selectionController.notInSelection),
531531
],
532532
),
533533
)

lib/widgets/content_art.dart

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,23 @@ class _SongScopedStorageArtSourceLoader extends _ArtSourceLoader {
423423
if (!state.mounted)
424424
return;
425425
_signal = CancellationSignal();
426-
_bytes = await ContentChannel.loadAlbumArt(
427-
uri: uri,
428-
size: Size.square(size) * MediaQuery.of(state.context).devicePixelRatio,
429-
signal: _signal!,
430-
);
431-
setLoading(_SourceLoading.loaded);
426+
try {
427+
_bytes = await ContentChannel.loadAlbumArt(
428+
uri: uri,
429+
size: Size.square(size) * MediaQuery.of(state.context).devicePixelRatio,
430+
signal: _signal!,
431+
);
432+
} on ContentChannelException catch (ex, stack) {
433+
if (ex != ContentChannelException.io) {
434+
FirebaseCrashlytics.instance.recordError(
435+
ex,
436+
stack,
437+
reason: 'in _SongScopedStorageArtSourceLoader.load',
438+
);
439+
}
440+
} finally {
441+
setLoading(_SourceLoading.loaded);
442+
}
432443
});
433444
}
434445

@@ -578,7 +589,11 @@ class _ArtistGeniusArtSourceLoader extends _ArtSourceLoader {
578589
final info = await artist.fetchInfo();
579590
_url = info.imageUrl;
580591
} catch (ex, stack) {
581-
FirebaseCrashlytics.instance.recordError(ex, stack);
592+
FirebaseCrashlytics.instance.recordError(
593+
ex,
594+
stack,
595+
reason: 'in _ArtistGeniusArtSourceLoader.load',
596+
);
582597
} finally {
583598
setLoading(_SourceLoading.loaded);
584599
}
@@ -598,7 +613,11 @@ class _ArtistGeniusArtSourceLoader extends _ArtSourceLoader {
598613
height: size,
599614
fit: BoxFit.cover,
600615
errorBuilder: (context, error, stacktrace) {
601-
FirebaseCrashlytics.instance.recordError(error, stacktrace);
616+
FirebaseCrashlytics.instance.recordError(
617+
error,
618+
stacktrace,
619+
reason: 'in _ArtistGeniusArtSourceLoader.getImage',
620+
);
602621
return state._buildDefault();
603622
},
604623
frameBuilder: state.frameBuilder,

lib/widgets/content_list_view/in_list_action.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,12 @@ class _InListContentActionState extends State<InListContentAction> with SingleTi
149149
}
150150

151151
class CreatePlaylistInListAction extends StatefulWidget {
152-
const CreatePlaylistInListAction({Key? key}) : super(key: key);
152+
const CreatePlaylistInListAction({
153+
Key? key ,
154+
this.enabled = true,
155+
}) : super(key: key);
156+
157+
final bool enabled;
153158

154159
@override
155160
State<CreatePlaylistInListAction> createState() => _CreatePlaylistInListActionState();
@@ -164,7 +169,7 @@ class _CreatePlaylistInListActionState extends State<CreatePlaylistInListAction>
164169
Widget build(BuildContext context) {
165170
final l10n = getl10n(context);
166171
return InListContentAction.persistentQueue(
167-
onTap: _handleTap,
172+
onTap: widget.enabled ? _handleTap : null,
168173
icon: Icons.add_rounded,
169174
text: l10n.newPlaylist,
170175
);

pubspec.lock

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,28 @@ packages:
9797
name: boxy
9898
url: "https://pub.dartlang.org"
9999
source: hosted
100-
version: "2.0.2"
100+
version: "2.0.3"
101101
cached_network_image:
102102
dependency: "direct main"
103103
description:
104104
name: cached_network_image
105105
url: "https://pub.dartlang.org"
106106
source: hosted
107-
version: "3.0.0"
107+
version: "3.1.0"
108+
cached_network_image_platform_interface:
109+
dependency: transitive
110+
description:
111+
name: cached_network_image_platform_interface
112+
url: "https://pub.dartlang.org"
113+
source: hosted
114+
version: "1.0.0"
115+
cached_network_image_web:
116+
dependency: transitive
117+
description:
118+
name: cached_network_image_web
119+
url: "https://pub.dartlang.org"
120+
source: hosted
121+
version: "1.0.0"
108122
characters:
109123
dependency: transitive
110124
description:
@@ -146,14 +160,14 @@ packages:
146160
name: cloud_functions_platform_interface
147161
url: "https://pub.dartlang.org"
148162
source: hosted
149-
version: "5.0.7"
163+
version: "5.0.8"
150164
cloud_functions_web:
151165
dependency: transitive
152166
description:
153167
name: cloud_functions_web
154168
url: "https://pub.dartlang.org"
155169
source: hosted
156-
version: "4.0.9"
170+
version: "4.0.10"
157171
collection:
158172
dependency: transitive
159173
description:
@@ -181,7 +195,7 @@ packages:
181195
name: dart_style
182196
url: "https://pub.dartlang.org"
183197
source: hosted
184-
version: "2.0.1"
198+
version: "2.0.2"
185199
device_info:
186200
dependency: "direct main"
187201
description:
@@ -251,7 +265,7 @@ packages:
251265
name: firebase_analytics
252266
url: "https://pub.dartlang.org"
253267
source: hosted
254-
version: "8.1.2"
268+
version: "8.2.0"
255269
firebase_analytics_platform_interface:
256270
dependency: transitive
257271
description:
@@ -272,7 +286,7 @@ packages:
272286
name: firebase_core
273287
url: "https://pub.dartlang.org"
274288
source: hosted
275-
version: "1.3.0"
289+
version: "1.4.0"
276290
firebase_core_platform_interface:
277291
dependency: transitive
278292
description:
@@ -293,14 +307,14 @@ packages:
293307
name: firebase_crashlytics
294308
url: "https://pub.dartlang.org"
295309
source: hosted
296-
version: "2.0.7"
310+
version: "2.1.1"
297311
firebase_crashlytics_platform_interface:
298312
dependency: transitive
299313
description:
300314
name: firebase_crashlytics_platform_interface
301315
url: "https://pub.dartlang.org"
302316
source: hosted
303-
version: "3.0.6"
317+
version: "3.1.0"
304318
flare_dart:
305319
dependency: transitive
306320
description:
@@ -564,7 +578,7 @@ packages:
564578
name: permission_handler_platform_interface
565579
url: "https://pub.dartlang.org"
566580
source: hosted
567-
version: "3.6.0"
581+
version: "3.6.1"
568582
petitparser:
569583
dependency: transitive
570584
description:
@@ -723,7 +737,7 @@ packages:
723737
name: test_api
724738
url: "https://pub.dartlang.org"
725739
source: hosted
726-
version: "0.4.1"
740+
version: "0.4.2"
727741
typed_data:
728742
dependency: transitive
729743
description:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ homepage: https://github.com/nt4f04uNd/sweyer
44
repository: https://github.com/nt4f04uNd/sweyer
55
issue_tracker: https://github.com/nt4f04uNd/sweyer/issues
66
publish_to: none
7-
version: 1.0.4+6
7+
version: 1.0.5+7
88

99
environment:
1010
sdk: '>=2.13.0 <3.0.0'

0 commit comments

Comments
 (0)