Fixing mypy errors
This commit is contained in:
@@ -759,11 +759,14 @@ class AdapterManager:
|
||||
# TODO (#189): allow this to take a set of schemes
|
||||
@staticmethod
|
||||
def get_song_filename_or_stream(
|
||||
song: Song, format: str = None, allow_song_downloads: bool = True,
|
||||
song: Song,
|
||||
format: str = None,
|
||||
force_stream: bool = False,
|
||||
allow_song_downloads: bool = True,
|
||||
) -> str:
|
||||
assert AdapterManager._instance
|
||||
cached_song_filename = None
|
||||
if AdapterManager._can_use_cache(False, "get_song_uri"):
|
||||
if AdapterManager._can_use_cache(force_stream, "get_song_uri"):
|
||||
assert AdapterManager._instance.caching_adapter
|
||||
try:
|
||||
return AdapterManager._instance.caching_adapter.get_song_uri(
|
||||
|
@@ -230,7 +230,7 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||
return header
|
||||
|
||||
def _create_label(
|
||||
self, text: str, *args, halign=Gtk.Align.START, **kwargs
|
||||
self, text: str, *args, halign: Gtk.Align = Gtk.Align.START, **kwargs
|
||||
) -> Gtk.Label:
|
||||
label = Gtk.Label(
|
||||
use_markup=True,
|
||||
@@ -341,7 +341,7 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||
self.connected_to_label = self._create_label(
|
||||
"<i>No Music Source Selected</i>",
|
||||
name="connected-to-label",
|
||||
halign=Gtk.Align.CENTER
|
||||
halign=Gtk.Align.CENTER,
|
||||
)
|
||||
vbox.add(self.connected_to_label)
|
||||
|
||||
|
@@ -366,8 +366,8 @@ def test_get_artist(adapter: SubsonicAdapter):
|
||||
assert len(artist.similar_artists) == 20
|
||||
assert (first_similar := artist.similar_artists[0])
|
||||
assert first_similar
|
||||
assert first_similar.name == 'Luke Combs'
|
||||
assert first_similar.artist_image_url == 'ar-158'
|
||||
assert first_similar.name == "Luke Combs"
|
||||
assert first_similar.artist_image_url == "ar-158"
|
||||
|
||||
|
||||
def test_get_artist_with_good_image_url(adapter: SubsonicAdapter):
|
||||
|
Reference in New Issue
Block a user