[gnome-music/wip/mschraal/type-checking: 4/6] grltrackerwrapper: Cleanup list comprehension
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/type-checking: 4/6] grltrackerwrapper: Cleanup list comprehension
- Date: Mon, 19 Oct 2020 14:32:58 +0000 (UTC)
commit d17b3aa8aff7167aa172c9db33df567db3bf8cfe
Author: Marinus Schraal <mschraal gnome org>
Date: Mon Oct 19 15:59:34 2020 +0200
grltrackerwrapper: Cleanup list comprehension
The old method returned an empty list, which trips up the type
checker.
gnomemusic/grilowrappers/grltrackerwrapper.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 4d30a522..cc4338f0 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -159,8 +159,10 @@ class GrlTrackerWrapper(GObject.GObject):
if change_type not in self._batch_changed_media_ids.keys():
self._batch_changed_media_ids[change_type] = []
- [self._batch_changed_media_ids[change_type].append(media.get_id())
- for media in medias if media.is_audio() or media.is_container()]
+ changed_medias = [
+ media.get_id() for media in medias
+ if media.is_audio() or media.is_container()]
+ self._batch_changed_media_ids[change_type].extend(changed_medias)
if self._content_changed_timeout == 0:
self._content_changed_timeout = GLib.timeout_add(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]