[gnome-music/wip/mschraal/grltrackerwrapper-small-optimization] grltrackerwrapper: Minor artist albums filter optimization
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/grltrackerwrapper-small-optimization] grltrackerwrapper: Minor artist albums filter optimization
- Date: Sun, 1 May 2022 13:52:30 +0000 (UTC)
commit 670d8ede999782963eccd0c6d8914cfea1d06604
Author: Marinus Schraal <mschraal gnome org>
Date: Sun May 1 15:35:12 2022 +0200
grltrackerwrapper: Minor artist albums filter optimization
More pythonic and faster.
gnomemusic/grilowrappers/grltrackerwrapper.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 680ba409f..dedb0e78e 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -710,7 +710,7 @@ class GrlTrackerWrapper(GObject.GObject):
'location_filter': self._tracker_wrapper.location_filter()
}
- albums: List[Grl.Media] = []
+ albums: List[str] = []
def query_cb(
source: Grl.Source, op_id: int, media: Optional[Grl.Media],
@@ -727,13 +727,12 @@ class GrlTrackerWrapper(GObject.GObject):
self._notificationmanager.pop_loading()
return
- albums.append(media)
+ albums.append(media.get_id())
def albums_filter(
- corealbum: CoreAlbum, albums: List[Grl.Media]) -> bool:
- for media in albums:
- if media.get_id() == corealbum.props.media.get_id():
- return True
+ corealbum: CoreAlbum, albums: List[str]) -> bool:
+ if corealbum.props.media.get_id() in albums:
+ return True
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]