Fix a few linter errors

This commit is contained in:
Sumner Evans
2020-05-10 01:18:57 -06:00
parent 51f66077b1
commit 60063a12a9
6 changed files with 10 additions and 8 deletions

View File

@@ -1113,8 +1113,8 @@ class SublimeMusicApp(Gtk.Application):
) # noqa: S001
AdapterManager.batch_download_songs(
[self.app_config.state.play_queue[i] for i in prefetch_idxs],
before_download=lambda: self.update_window,
on_song_download_complete=lambda: self.update_window,
before_download=lambda: self.update_window(),
on_song_download_complete=lambda: self.update_window(),
)
if old_play_queue:

View File

@@ -24,7 +24,6 @@ from typing import (
List,
Optional,
Set,
Tuple,
TypeVar,
Union,
)

View File

@@ -17,7 +17,6 @@ import pychromecast
from sublime.adapters import AdapterManager
from sublime.adapters.api_objects import Song
from sublime.cache_manager import CacheManager
from sublime.config import AppConfiguration

View File

@@ -1,5 +1,5 @@
import datetime
from typing import Any, Callable, cast, Iterable, Optional, Tuple, Union
from typing import Any, Callable, Iterable, Optional, Tuple, Union
import gi
@@ -43,6 +43,7 @@ class AlbumsPanel(Gtk.Box):
self.sort_type_combo = self.make_combobox(
(
("random", "randomly", True),
# TODO this needs to be updated after the ping
("byGenre", "by genre", AdapterManager.can_get_genres()),
("newest", "by most recently added", True),
("highest", "by highest rated", True),

View File

@@ -728,10 +728,14 @@ class PlaylistDetailPanel(Gtk.Overlay):
)
def _format_stats(self, playlist: PlaylistDetails) -> str:
created_date = playlist.created.strftime("%B %d, %Y")
created_date_text = ""
if playlist.created:
created_date_text = " on {playlist.created.strftime('%B %d, %Y')}"
created_text = f"Created by {playlist.owner}{created_date_text}"
lines = [
util.dot_join(
f"Created by {playlist.owner} on {created_date}",
created_text,
f"{'Not v' if not playlist.public else 'V'}isible to others",
),
util.dot_join(

View File

@@ -9,7 +9,6 @@ import pytest
from sublime import util
from sublime.adapters import CacheMissError
from sublime.adapters.filesystem import FilesystemAdapter
from sublime.adapters.filesystem import models
from sublime.adapters.subsonic import api_objects as SubsonicAPI
MOCK_DATA_FILES = Path(__file__).parent.joinpath("mock_data")