From cbdf583c5cbbebdd7672cf8bd5874e84400e6431 Mon Sep 17 00:00:00 2001
From: Yifan J <yifanj2007@gmail.com>
Date: Wed, 11 Aug 2021 16:06:22 +0800
Subject: [PATCH 1/2] Revert "grltrackerwrapper: Add static type annotations"

This reverts commit 54dd7286338a509acb4f4ce9a8072dcc395c9e48.
---
 gnomemusic/grilowrappers/grltrackerwrapper.py | 247 +++++++-----------
 1 file changed, 93 insertions(+), 154 deletions(-)

diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 72e477be..3aa761cc 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -22,10 +22,6 @@
 # code, but you are not obligated to do so.  If you do not wish to do so,
 # delete this exception statement from your version.
 
-from __future__ import annotations
-from typing import Callable, Dict, List, Optional
-import typing
-
 import gi
 gi.require_versions({"Gfm": "0.1", "Grl": "0.3", "Tracker": "3.0"})
 from gi.repository import Gfm, Gio, Grl, GLib, GObject, Tracker
@@ -34,24 +30,17 @@ from gnomemusic.corealbum import CoreAlbum
 from gnomemusic.coreartist import CoreArtist
 from gnomemusic.coredisc import CoreDisc
 from gnomemusic.coresong import CoreSong
-from gnomemusic.grilowrappers.grltrackerplaylists import (
-    GrlTrackerPlaylists, Playlist)
+from gnomemusic.grilowrappers.grltrackerplaylists import GrlTrackerPlaylists
 from gnomemusic.storeart import StoreArt
-from gnomemusic.trackerwrapper import TrackerWrapper
-if typing.TYPE_CHECKING:
-    from gnomemusic.application import Application
-    from gnomemusic.coremodel import CoreModel
-    from gnomemusic.musiclogger import MusicLogger
-    from gnomemusic.notificationmanager import NotificationManager
 
 
 class GrlTrackerWrapper(GObject.GObject):
     """Wrapper for the Grilo Tracker source.
     """
 
-    _SPLICE_SIZE: int = 100
+    _SPLICE_SIZE = 100
 
-    _METADATA_ALBUM_CHANGED_KEYS: List[int] = [
+    _METADATA_ALBUM_CHANGED_KEYS = [
         Grl.METADATA_KEY_ARTIST,
         Grl.METADATA_KEY_ALBUM_ARTIST,
         Grl.METADATA_KEY_COMPOSER,
@@ -61,7 +50,7 @@ class GrlTrackerWrapper(GObject.GObject):
         Grl.METADATA_KEY_URL
     ]
 
-    _METADATA_SONG_FILL_KEYS: List[int] = [
+    _METADATA_SONG_FILL_KEYS = [
         Grl.METADATA_KEY_ALBUM,
         Grl.METADATA_KEY_ALBUM_DISC_NUMBER,
         Grl.METADATA_KEY_ARTIST,
@@ -74,7 +63,7 @@ class GrlTrackerWrapper(GObject.GObject):
         Grl.METADATA_KEY_URL
     ]
 
-    _METADATA_SONG_MEDIA_QUERY_KEYS: List[int] = [
+    _METADATA_SONG_MEDIA_QUERY_KEYS = [
         Grl.METADATA_KEY_ALBUM,
         Grl.METADATA_KEY_ALBUM_DISC_NUMBER,
         Grl.METADATA_KEY_ARTIST,
@@ -87,14 +76,12 @@ class GrlTrackerWrapper(GObject.GObject):
         Grl.METADATA_KEY_URL
     ]
 
-    _METADATA_THUMBNAIL_KEYS: List[int] = [
+    _METADATA_THUMBNAIL_KEYS = [
         Grl.METADATA_KEY_ID,
         Grl.METADATA_KEY_THUMBNAIL
     ]
 
-    def __init__(
-            self, source: Grl.Source, application: Application,
-            tracker_wrapper: TrackerWrapper) -> None:
+    def __init__(self, source, application, tracker_wrapper):
         """Initialize the Tracker wrapper
 
         :param Grl.TrackerSource source: The Tracker source to wrap
@@ -103,43 +90,40 @@ class GrlTrackerWrapper(GObject.GObject):
         """
         super().__init__()
 
-        self._application: Application = application
-        cm: CoreModel = application.props.coremodel
-        self._log: MusicLogger = application.props.log
+        self._application = application
+        coremodel = application.props.coremodel
+        self._log = application.props.log
         self._songs_model = Gio.ListStore.new(CoreSong)
-        cm.props.songs_proxy.append(self._songs_model)
-        self._source: Optional[Grl.Source] = None
+        coremodel.props.songs_proxy.append(self._songs_model)
+        self._source = None
         self._albums_model = Gio.ListStore.new(CoreAlbum)
-        cm.props.albums_proxy.append(self._albums_model)
-        self._album_ids: Dict[str, CoreAlbum] = {}
+        coremodel.props.albums_proxy.append(self._albums_model)
+        self._album_ids = {}
         self._artists_model = Gio.ListStore.new(CoreArtist)
-        cm.props.artists_proxy.append(self._artists_model)
-        self._artist_ids: Dict[str, CoreArtist] = {}
-        self._hash: Dict[str, CoreSong] = {}
-        self._song_search_proxy: Gio.ListStore = cm.props.songs_search_proxy
-        self._album_search_model: Gfm.FilterListModel = cm.props.albums_search
-        self._artist_search_model: Gfm.FilterListModel = (
-            cm.props.artists_search)
-        self._batch_changed_media_ids: Dict[
-            Grl.SourceChangeType, List[str]] = {}
-        self._content_changed_timeout: int = 0
-        self._tracker_playlists: Optional[GrlTrackerPlaylists] = None
-        self._tracker_wrapper: TrackerWrapper = tracker_wrapper
-        self._notificationmanager: NotificationManager = (
-            application.props.notificationmanager)
+        coremodel.props.artists_proxy.append(self._artists_model)
+        self._artist_ids = {}
+        self._hash = {}
+        self._song_search_proxy = coremodel.props.songs_search_proxy
+        self._album_search_model = coremodel.props.albums_search
+        self._artist_search_model = coremodel.props.artists_search
+        self._batch_changed_media_ids = {}
+        self._content_changed_timeout = 0
+        self._tracker_playlists = None
+        self._tracker_wrapper = tracker_wrapper
+        self._notificationmanager = application.props.notificationmanager
 
         self._song_search_tracker = Gfm.FilterListModel.new(self._songs_model)
         self._song_search_tracker.set_filter_func(lambda a: False)
         self._song_search_proxy.append(self._song_search_tracker)
 
-        self._fast_options: Grl.OperationOptions = Grl.OperationOptions()
+        self._fast_options = Grl.OperationOptions()
         self._fast_options.set_resolution_flags(
             Grl.ResolutionFlags.FAST_ONLY | Grl.ResolutionFlags.IDLE_RELAY)
-        self._full_options: Grl.OperationOptions = Grl.OperationOptions()
+        self._full_options = Grl.OperationOptions()
         self._full_options.set_resolution_flags(
             Grl.ResolutionFlags.FULL | Grl.ResolutionFlags.IDLE_RELAY)
 
-        self._content_changed_id: int = 0
+        self._content_changed_id = 0
         self.props.source = source
 
         self._initial_songs_fill()
@@ -147,11 +131,11 @@ class GrlTrackerWrapper(GObject.GObject):
         self._initial_artists_fill()
 
     @GObject.Property(type=Grl.Source, default=None)
-    def source(self) -> Grl.Source:
+    def source(self):
         return self._source
 
     @source.setter  # type: ignore
-    def source(self, new_source: Grl.Source):
+    def source(self, new_source):
         """Set a new grilo tracker source
 
         Everytime, the tracker plugin is loaded, a new source is
@@ -168,9 +152,7 @@ class GrlTrackerWrapper(GObject.GObject):
         self._content_changed_id = self._source.connect(
             "content-changed", self._batch_content_changed)
 
-    def _batch_content_changed(
-            self, source: Grl.Source, medias: List[Grl.Media],
-            change_type: Grl.SourceChangeType, loc_unknown: bool) -> None:
+    def _batch_content_changed(self, source, medias, change_type, loc_unknown):
         if medias == []:
             return
 
@@ -191,9 +173,9 @@ class GrlTrackerWrapper(GObject.GObject):
             self._content_changed_timeout = GLib.timeout_add(
                 250, self._on_content_changed)
 
-    def _on_content_changed(self) -> bool:
+    def _on_content_changed(self):
         for change_type in self._batch_changed_media_ids.keys():
-            media_ids: List[str] = self._batch_changed_media_ids[change_type]
+            media_ids = self._batch_changed_media_ids[change_type]
 
             # The Tracker indexed paths may differ from Music's paths.
             # In that case Tracker will report it as 'changed', while
@@ -218,8 +200,8 @@ class GrlTrackerWrapper(GObject.GObject):
 
         return GLib.SOURCE_REMOVE
 
-    def _check_album_change(self) -> None:
-        album_ids: Dict[str, CoreAlbum] = {}
+    def _check_album_change(self):
+        album_ids = {}
 
         query = """
         SELECT
@@ -258,9 +240,7 @@ class GrlTrackerWrapper(GObject.GObject):
             'location_filter': self._tracker_wrapper.location_filter()
         }
 
-        def check_album_cb(
-                source: Grl.Source, op_id: int, media: Optional[Grl.Media],
-                remaining: int, error: str) -> None:
+        def check_album_cb(source, op_id, media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 return
@@ -295,8 +275,8 @@ class GrlTrackerWrapper(GObject.GObject):
             query, self._METADATA_ALBUM_CHANGED_KEYS, self._fast_options,
             check_album_cb)
 
-    def _check_artist_change(self) -> None:
-        artist_ids: Dict[str, CoreArtist] = {}
+    def _check_artist_change(self):
+        artist_ids = {}
 
         query = """
         SELECT ?type ?id ?artist
@@ -335,9 +315,7 @@ class GrlTrackerWrapper(GObject.GObject):
             Grl.METADATA_KEY_ID
         ]
 
-        def check_artist_cb(
-                source: Grl.Source, op_id: int, media: Optional[Grl.Media],
-                remaining: int, error: Optional[GLib.Error]) -> None:
+        def check_artist_cb(source, op_id, media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 return
@@ -370,7 +348,7 @@ class GrlTrackerWrapper(GObject.GObject):
         self.props.source.query(
             query, metadata_keys, self._fast_options, check_artist_cb)
 
-    def _remove_media(self, media_ids: List[str]) -> None:
+    def _remove_media(self, media_ids):
         for media_id in media_ids:
             try:
                 coresong = self._hash.pop(media_id)
@@ -386,9 +364,8 @@ class GrlTrackerWrapper(GObject.GObject):
                     self._songs_model.remove(idx)
                     break
 
-    def _song_media_query(self, ids: List[str]) -> str:
-        media_ids: str = str(ids)[1:-1].replace("'", "")
-
+    def _song_media_query(self, media_ids):
+        media_ids = str(media_ids)[1:-1]
         query = """
         SELECT
             ?type ?urn ?title ?id ?url
@@ -433,11 +410,9 @@ class GrlTrackerWrapper(GObject.GObject):
 
         return query
 
-    def _changed_media(self, media_ids: List[str]) -> None:
+    def _changed_media(self, media_ids):
 
-        def _update_changed_media(
-                source: Grl.Source, op_id: int, media: Optional[Grl.Media],
-                remaining: int, error: Optional[GLib.Error]) -> None:
+        def _update_changed_media(source, op_id, media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 return
@@ -446,7 +421,7 @@ class GrlTrackerWrapper(GObject.GObject):
                 self._remove_media(media_ids)
                 return
 
-            media_id: str = media.get_id()
+            media_id = media.get_id()
             if media_id not in self._hash:
                 song = CoreSong(self._application, media)
                 self._songs_model.append(song)
@@ -463,13 +438,11 @@ class GrlTrackerWrapper(GObject.GObject):
             self._METADATA_SONG_MEDIA_QUERY_KEYS, self._fast_options,
             _update_changed_media)
 
-    def _initial_songs_fill(self) -> None:
+    def _initial_songs_fill(self):
         self._notificationmanager.push_loading()
-        songs_added: List[int] = []
+        songs_added = []
 
-        def _add_to_model(
-                source: Grl.Source, op_id: int, media: Optional[Grl.Media],
-                remaining: int, error: Optional[GLib.Error]) -> None:
+        def _add_to_model(source, op_id, media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 self._notificationmanager.pop_loading()
@@ -542,13 +515,11 @@ class GrlTrackerWrapper(GObject.GObject):
             query, self._METADATA_SONG_FILL_KEYS, self._fast_options,
             _add_to_model)
 
-    def _initial_albums_fill(self) -> None:
+    def _initial_albums_fill(self):
         self._notificationmanager.push_loading()
-        albums_added: List[int] = []
+        albums_added = []
 
-        def _add_to_albums_model(
-                source: Grl.Source, op_id: int, media: Optional[Grl.Media],
-                remaining: int, error: Optional[GLib.Error]) -> None:
+        def _add_to_albums_model(source, op_id, media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 self._notificationmanager.pop_loading()
@@ -613,13 +584,11 @@ class GrlTrackerWrapper(GObject.GObject):
             query, self._METADATA_ALBUM_CHANGED_KEYS, self._fast_options,
             _add_to_albums_model)
 
-    def _initial_artists_fill(self) -> None:
+    def _initial_artists_fill(self):
         self._notificationmanager.push_loading()
-        artists_added: List[int] = []
+        artists_added = []
 
-        def _add_to_artists_model(
-                source: Grl.Source, op_id: int, media: Optional[Grl.Media],
-                remaining: int, error: Optional[GLib.Error]) -> None:
+        def _add_to_artists_model(source, op_id, media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 self._notificationmanager.pop_loading()
@@ -671,7 +640,7 @@ class GrlTrackerWrapper(GObject.GObject):
             'location_filter': self._tracker_wrapper.location_filter()
         }
 
-        metadata_keys: List[int] = [
+        metadata_keys = [
             Grl.METADATA_KEY_ARTIST,
             Grl.METADATA_KEY_ID
         ]
@@ -679,8 +648,7 @@ class GrlTrackerWrapper(GObject.GObject):
         self.props.source.query(
             query, metadata_keys, self._fast_options, _add_to_artists_model)
 
-    def get_artist_albums(
-            self, media: Grl.Source, model: Gfm.FilterListModel) -> None:
+    def get_artist_albums(self, media, model):
         """Get all albums by an artist
 
         :param Grl.Media media: The media with the artist id
@@ -722,11 +690,9 @@ class GrlTrackerWrapper(GObject.GObject):
             'location_filter': self._tracker_wrapper.location_filter()
         }
 
-        albums: List[Grl.Media] = []
+        albums = []
 
-        def query_cb(
-                source: Grl.Source, op_id: int, media: Optional[Grl.Media],
-                remaining: int, error: Optional[GLib.Error]) -> None:
+        def query_cb(source, op_id, media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 self._notificationmanager.pop_loading()
@@ -739,8 +705,7 @@ class GrlTrackerWrapper(GObject.GObject):
 
             albums.append(media)
 
-        def albums_filter(
-                corealbum: CoreAlbum, albums: List[Grl.Media]) -> bool:
+        def albums_filter(corealbum, albums):
             for media in albums:
                 if media.get_id() == corealbum.props.media.get_id():
                     return True
@@ -750,8 +715,7 @@ class GrlTrackerWrapper(GObject.GObject):
         self.props.source.query(
             query, [Grl.METADATA_KEY_TITLE], self._fast_options, query_cb)
 
-    def get_album_discs(
-            self, media: Grl.Media, disc_model: Gfm.SortListModel) -> None:
+    def get_album_discs(self, media, disc_model):
         """Get all discs of an album
 
         :param Grl.Media media: The media with the album id
@@ -788,9 +752,7 @@ class GrlTrackerWrapper(GObject.GObject):
             'location_filter': self._tracker_wrapper.location_filter()
         }
 
-        def _disc_nr_cb(
-                source: Grl.Source, op_id: int, media: Optional[Grl.Media],
-                remaining: int, error: Optional[GLib.Error]) -> None:
+        def _disc_nr_cb(source, op_id, media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 self._notificationmanager.pop_loading()
@@ -808,11 +770,7 @@ class GrlTrackerWrapper(GObject.GObject):
             query, [Grl.METADATA_KEY_ALBUM_DISC_NUMBER], self._fast_options,
             _disc_nr_cb)
 
-    def populate_album_disc_songs(
-            self, media: Grl.Media, disc_nr: int,
-            callback: Callable[
-                [Grl.Source, int, Optional[Grl.Media], int,
-                 Optional[GLib.Error]], None]) -> None:
+    def populate_album_disc_songs(self, media, disc_nr, callback):
         # FIXME: Pass a model and fill it.
         # FIXME: The query is similar to the other song queries, reuse
         # if possible.
@@ -822,7 +780,7 @@ class GrlTrackerWrapper(GObject.GObject):
         :param int disc_nr: The disc number
         :param callback: The callback to call for every song added
         """
-        album_id: str = media.get_id()
+        album_id = media.get_id()
 
         query = """
         SELECT
@@ -874,7 +832,7 @@ class GrlTrackerWrapper(GObject.GObject):
             'miner_fs_busname': self._tracker_wrapper.props.miner_fs_busname
         }
 
-        metadata_keys: List[int] = [
+        metadata_keys = [
             Grl.METADATA_KEY_ALBUM,
             Grl.METADATA_KEY_ALBUM_DISC_NUMBER,
             Grl.METADATA_KEY_ARTIST,
@@ -889,13 +847,13 @@ class GrlTrackerWrapper(GObject.GObject):
         self.props.source.query(
             query, metadata_keys, self._fast_options, callback)
 
-    def search(self, text: str) -> None:
+    def search(self, text):
         # FIXME: Searches are limited to not bog down the UI with
         # widget creation ({List,Flow}Box limitations). The limit is
         # arbitrarily set to 50 and set in the Tracker query. It should
         # be possible to set it through Grilo options instead. This
         # does not work as expected and needs further investigation.
-        term: str = Tracker.sparql_escape_string(
+        term = Tracker.sparql_escape_string(
             GLib.utf8_normalize(
                 GLib.utf8_casefold(text, -1), -1, GLib.NormalizeMode.NFKD))
 
@@ -953,14 +911,12 @@ class GrlTrackerWrapper(GObject.GObject):
             'name': term
         }
 
-        artist_filter_ids: List[str] = []
+        artist_filter_ids = []
 
-        def artist_filter(coreartist: CoreArtist) -> bool:
+        def artist_filter(coreartist):
             return coreartist.media.get_id() in artist_filter_ids
 
-        def artist_search_cb(
-                source: Grl.Source, op_id: int, media: Optional[Grl.Media],
-                remaining: int, error: Optional[GLib.Error]) -> None:
+        def artist_search_cb(source, op_id, media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 self._notificationmanager.pop_loading()
@@ -1022,14 +978,12 @@ class GrlTrackerWrapper(GObject.GObject):
             'name': term
         }
 
-        album_filter_ids: List[str] = []
+        album_filter_ids = []
 
-        def album_filter(corealbum: CoreAlbum) -> bool:
+        def album_filter(corealbum):
             return corealbum.media.get_id() in album_filter_ids
 
-        def albums_search_cb(
-                source: Grl.Source, op_id: int, media: Optional[Grl.Media],
-                remaining: int, error: Optional[GLib.Error]) -> None:
+        def albums_search_cb(source, op_id, media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 self._notificationmanager.pop_loading()
@@ -1096,14 +1050,12 @@ class GrlTrackerWrapper(GObject.GObject):
             'name': term
         }
 
-        filter_ids: List[str] = []
+        filter_ids = []
 
-        def songs_filter(coresong: CoreSong) -> bool:
+        def songs_filter(coresong):
             return coresong.media.get_id() in filter_ids
 
-        def songs_search_cb(
-                source: Grl.Source, op_id: int, media: Optional[Grl.Media],
-                remaining: int, error: Optional[GLib.Error]) -> None:
+        def songs_search_cb(source, op_id, media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 self._notificationmanager.pop_loading()
@@ -1119,8 +1071,7 @@ class GrlTrackerWrapper(GObject.GObject):
         self.props.source.query(
             query, [Grl.METADATA_KEY_ID], self._fast_options, songs_search_cb)
 
-    def _get_album_for_media_id_query(
-            self, media_id: str, song: bool = True) -> str:
+    def _get_album_for_media_id_query(self, media_id, song=True):
         # Even though we check for the album_artist, we fill
         # the artist key, since Grilo coverart plugins use
         # only that key for retrieval.
@@ -1180,7 +1131,7 @@ class GrlTrackerWrapper(GObject.GObject):
 
         return query
 
-    def get_song_art(self, coresong: CoreSong) -> None:
+    def get_song_art(self, coresong):
         """Retrieve song art for the given CoreSong
 
         Since MediaArt does not really support per-song art this
@@ -1189,7 +1140,7 @@ class GrlTrackerWrapper(GObject.GObject):
 
         :param CoreSong coresong: CoreSong to get art for
         """
-        media: Grl.Media = coresong.props.media
+        media = coresong.props.media
 
         # If there is no album and artist do not go through with the
         # query, it will not give any results.
@@ -1199,10 +1150,7 @@ class GrlTrackerWrapper(GObject.GObject):
             coresong.props.thumbnail = "generic"
             return
 
-        def art_retrieved_cb(
-                source: Grl.Source, op_id: int,
-                queried_media: Optional[Grl.Media], remaining: int,
-                error: Optional[GLib.Error]) -> None:
+        def art_retrieved_cb(source, op_id, queried_media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 coresong.props.thumbnail = "generic"
@@ -1214,24 +1162,21 @@ class GrlTrackerWrapper(GObject.GObject):
 
             StoreArt(coresong, queried_media.get_thumbnail())
 
-        song_id: str = media.get_id()
-        query: str = self._get_album_for_media_id_query(song_id)
+        song_id = media.get_id()
+        query = self._get_album_for_media_id_query(song_id)
 
         self.props.source.query(
             query, self._METADATA_THUMBNAIL_KEYS, self._full_options,
             art_retrieved_cb)
 
-    def get_album_art(self, corealbum: CoreAlbum) -> None:
+    def get_album_art(self, corealbum):
         """Retrieve album art for the given CoreAlbum
 
         :param CoreAlbum corealbum: CoreAlbum to get art for
         """
-        media: Grl.Media = corealbum.props.media
+        media = corealbum.props.media
 
-        def art_retrieved_cb(
-                source: Grl.Source, op_id: int,
-                queried_media: Optional[Grl.Media], remaining: int,
-                error: Optional[GLib.Error]) -> None:
+        def art_retrieved_cb(source, op_id, queried_media, remaining, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 corealbum.props.thumbnail = "generic"
@@ -1243,26 +1188,23 @@ class GrlTrackerWrapper(GObject.GObject):
 
             StoreArt(corealbum, queried_media.get_thumbnail())
 
-        album_id: str = media.get_id()
-        query: str = self._get_album_for_media_id_query(album_id, False)
+        album_id = media.get_id()
+        query = self._get_album_for_media_id_query(album_id, False)
 
-        self.props.source.query(
+        self._source.query(
             query, self._METADATA_THUMBNAIL_KEYS, self._full_options,
             art_retrieved_cb)
 
-    def get_artist_art(self, coreartist: CoreArtist) -> None:
+    def get_artist_art(self, coreartist):
         """Retrieve artist art for the given CoreArtist
 
         This retrieves art through Grilo online services only.
 
         :param CoreArtist coreartist: CoreArtist to get art for
         """
-        media: Grl.Media = coreartist.props.media
+        media = coreartist.props.media
 
-        def art_resolved_cb(
-                source: Grl.Source, op_id: int,
-                resolved_media: Optional[Grl.Media],
-                error: Optional[GLib.Error]) -> None:
+        def art_resolved_cb(source, op_id, resolved_media, error):
             if error:
                 self._log.warning("Error: {}".format(error))
                 coreartist.props.thumbnail = "generic"
@@ -1278,7 +1220,7 @@ class GrlTrackerWrapper(GObject.GObject):
             media, [Grl.METADATA_KEY_THUMBNAIL], self._full_options,
             art_resolved_cb)
 
-    def stage_playlist_deletion(self, playlist: Optional[Playlist]) -> None:
+    def stage_playlist_deletion(self, playlist):
         """Prepares playlist deletion.
 
         :param Playlist playlist: playlist
@@ -1288,8 +1230,7 @@ class GrlTrackerWrapper(GObject.GObject):
 
         self._tracker_playlists.stage_playlist_deletion(playlist)
 
-    def finish_playlist_deletion(
-            self, playlist: Optional[Playlist], deleted: bool) -> None:
+    def finish_playlist_deletion(self, playlist, deleted):
         """Finishes playlist deletion.
 
         :param Playlist playlist: playlist
@@ -1300,9 +1241,7 @@ class GrlTrackerWrapper(GObject.GObject):
 
         self._tracker_playlists.finish_playlist_deletion(playlist, deleted)
 
-    def create_playlist(
-            self, playlist_title: str,
-            callback: Callable[[Playlist], None]) -> None:
+    def create_playlist(self, playlist_title, callback):
         """Creates a new user playlist.
 
         :param str playlist_title: playlist title
-- 
2.31.1

