style: format all code to PEP8 (flake8 clean)
Reformat every module with autopep8 and hand-tune the remaining long lines so that `flake8` passes with default settings (max line length 79). No behavior changes: long f-strings, messages, QSS/Textual CSS rules and argument lists are only wrapped or split, an unused import and an unused local are dropped, and dbus-next D-Bus signature annotations carry targeted `# noqa` comments.
This commit is contained in:
8
media.py
8
media.py
@@ -3,7 +3,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from mtsmusic import CONFIG_DIR
|
||||
|
||||
@@ -12,7 +11,8 @@ HISTORY_LIMIT = 100
|
||||
|
||||
|
||||
def track_artist(track: dict) -> str:
|
||||
return ", ".join(a.get("name", "?") for a in track.get("artists") or []) or "?"
|
||||
return ", ".join(a.get("name", "?")
|
||||
for a in track.get("artists") or []) or "?"
|
||||
|
||||
|
||||
def track_album(track: dict) -> str:
|
||||
@@ -58,7 +58,9 @@ def record_history(track: dict) -> list[dict]:
|
||||
track_id = str(track.get("id") or "")
|
||||
if not track_id:
|
||||
return load_history()
|
||||
history = [item for item in load_history() if str(item.get("id")) != track_id]
|
||||
history = [
|
||||
item for item in load_history() if str(
|
||||
item.get("id")) != track_id]
|
||||
history.insert(0, track)
|
||||
history = history[:HISTORY_LIMIT]
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user