# if playlist has no default image (e.g. a local playlist)
if images and (not playlist.image or playlist.image.provider != "url"):
if playlist.image and self.mass.storage_path in playlist.image.path:
- # re-use previous created path
+ # reuse previous created path
img_path = playlist.image.path
else:
img_path = os.path.join(self.mass.storage_path, f"{uuid4().hex}.png")
sql_query = f'INSERT OR REPLACE INTO {table}({",".join(keys)})'
else:
sql_query = f'INSERT INTO {table}({",".join(keys)})'
- sql_query += f' VALUES ({",".join((f":{x}" for x in keys))})'
+ sql_query += f' VALUES ({",".join(f":{x}" for x in keys)})'
await self.execute(sql_query, values)
await self._db.commit()
# return inserted/replaced item
) -> Mapping:
"""Update record."""
keys = tuple(values.keys())
- sql_query = f'UPDATE {table} SET {",".join((f"{x}=:{x}" for x in keys))} WHERE '
+ sql_query = f'UPDATE {table} SET {",".join(f"{x}=:{x}" for x in keys)} WHERE '
sql_query += " AND ".join(f"{x} = :{x}" for x in match)
await self.execute(sql_query, {**match, **values})
await self._db.commit()
# the only multi-item splitter we accept is the semicolon,
# which is also the default in Musicbrainz Picard.
-# the slash is also a common splitter but causes colissions with
+# the slash is also a common splitter but causes collisions with
# artists actually containing a slash in the name, such as ACDC
TAG_SPLITTER = ";"
# track artist(s)
for index, track_artist_str in enumerate(tags.artists):
- # re-use album artist details if possible
+ # reuse album artist details if possible
if track.album and (
album_artist := next(
(x for x in track.album.artists if x.name == track_artist_str), None
"codespell==2.2.5",
"mypy==1.5.1",
"ruff==0.1.1",
- "pytest==7.4.0",
+ "pytest==7.4.3",
"pytest-asyncio==0.21.1",
"pytest-aiohttp==1.0.4",
"pytest-cov==4.1.0",