Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Oct 27, 2023
1 parent b12fc77 commit 8b3e067
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion music_assistant/server/controllers/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ async def get_playlist_metadata(self, playlist: Playlist) -> None:
# 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")
Expand Down
4 changes: 2 additions & 2 deletions music_assistant/server/helpers/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def insert(
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
Expand All @@ -120,7 +120,7 @@ async def update(
) -> 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()
Expand Down
2 changes: 1 addition & 1 deletion music_assistant/server/helpers/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# 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 = ";"

Expand Down
2 changes: 1 addition & 1 deletion music_assistant/server/providers/filesystem_local/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ async def _parse_track(

# 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
Expand Down

0 comments on commit 8b3e067

Please sign in to comment.