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:
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
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")):
"pytest-cov==5.0.0",
"syrupy==4.8.0",
"tomli==2.2.1",
- "ruff==0.7.4",
+ "ruff==0.8.4",
]
[project.scripts]
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
"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
"FBT002",
"FBT003",
"ANN001",
- "ANN102",
"ANN201",
"ANN202",
"TRY002",