Chore(deps): Bump ruff from 0.7.4 to 0.8.4 (#1813)
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sat, 4 Jan 2025 14:02:42 +0000 (15:02 +0100)
committerGitHub <noreply@github.com>
Sat, 4 Jan 2025 14:02:42 +0000 (15:02 +0100)
* Chore(deps): Bump ruff from 0.7.4 to 0.8.4

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.7.4 to 0.8.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.7.4...0.8.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
* lint

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
music_assistant/controllers/cache.py
music_assistant/controllers/metadata.py
music_assistant/helpers/playlists.py
pyproject.toml

index 9df242f575eb3e9a263ff736753e4fc31de81cc7..359f99922c49d1cca773631aeab638585282cc2a 100644 (file)
@@ -109,7 +109,7 @@ class CacheController(CoreController):
             db_row := await self.database.get_row(
                 DB_TABLE_CACHE, {"category": category, "base_key": base_key, "sub_key": key}
             )
-        ) and (not checksum or db_row["checksum"] == checksum and db_row["expires"] >= cur_time):
+        ) and (not checksum or (db_row["checksum"] == checksum and db_row["expires"] >= cur_time)):
             try:
                 data = await asyncio.to_thread(json_loads, db_row["data"])
             except Exception as exc:
index 19b4259c94224a169d135b17e497425845d34dd4..a345ec6c50020b91bd4f2e1b8350fd57e7d68fa9 100644 (file)
@@ -410,7 +410,7 @@ class MetaDataController(CoreController):
         fanart: bool = False,
     ) -> MediaItemImage | None:
         """Create collage thumb/fanart image for (in-library) playlist."""
-        if len(images) < 8 and fanart or len(images) < 3:
+        if (len(images) < 8 and fanart) or len(images) < 3:
             # require at least some images otherwise this does not make a lot of sense
             return None
         # limit to 50 images to prevent we're going OOM
index 9d72381b63da7bbe4cabe28b3b0829bba688b9ce..f1cbbfd3a0c3bfcac56e9131e0755ac7ceb579cb 100644 (file)
@@ -164,7 +164,9 @@ async def fetch_playlist(
         msg = f"Error while fetching playlist {url}"
         raise InvalidDataError(msg) from err
 
-    if raise_on_hls and "#EXT-X-VERSION:" in playlist_data or "#EXT-X-STREAM-INF:" in playlist_data:
+    if (
+        raise_on_hls and "#EXT-X-VERSION:" in playlist_data
+    ) or "#EXT-X-STREAM-INF:" in playlist_data:
         raise IsHLSPlaylist
 
     if url.endswith((".m3u", ".m3u8")):
index 90a63d2ddb1fe175975be8601fe483adde9ac815..b720c4e6096c80d2199cdc43044afa09d4796a0d 100644 (file)
@@ -52,7 +52,7 @@ test = [
   "pytest-cov==5.0.0",
   "syrupy==4.8.0",
   "tomli==2.2.1",
-  "ruff==0.7.4",
+  "ruff==0.8.4",
 ]
 
 [project.scripts]
@@ -129,7 +129,6 @@ asyncio_mode = "auto"
 ignore = [
   "ANN002", # Just annoying, not really useful
   "ANN003", # Just annoying, not really useful
-  "ANN101", # Self... explanatory
   "ANN401", # Opinioated warning on disallowing dynamically typed expressions
   "D203", # Conflicts with other rules
   "D213", # Conflicts with other rules
@@ -140,8 +139,8 @@ ignore = [
   "PLR2004", # Just annoying, not really useful
   "PD011", # Just annoying, not really useful
   "S101", # assert is often used to satisfy type checking
-  "TCH001", # Just annoying, not really useful
-  "TCH003", # Just annoying, not really useful
+  "TC001", # Just annoying, not really useful
+  "TC003", # Just annoying, not really useful
   "TD002", # Just annoying, not really useful
   "TD003", # Just annoying, not really useful
   "TD004", # Just annoying, not really useful
@@ -154,7 +153,6 @@ ignore = [
   "FBT002",
   "FBT003",
   "ANN001",
-  "ANN102",
   "ANN201",
   "ANN202",
   "TRY002",