Skip to content

Commit

Permalink
server: fix mypy/pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
dxstiny committed Jun 20, 2024
1 parent eb5e7a9 commit dc87f7b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/server/db/table/albums.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ def __init__( # pylint: disable=too-many-arguments
@classmethod
def disabled(cls) -> SpotifyAlbumData:
"""create from id"""
return SpotifyAlbumData("", [], 0, "", None, "", [], [], cls._DISABLED, "", 0, "", "")
return SpotifyAlbumData("", [], 0, "", None, "", [], [], cls._DISABLED, "", 0, "")

@classmethod
def fromId(cls, id_: str) -> SpotifyAlbumData:
"""create from id"""
return SpotifyAlbumData(id_, [], 0, "", None, "", [], [], cls._DISABLED, "", 0, "", "")
return SpotifyAlbumData(id_, [], 0, "", None, "", [], [], cls._DISABLED, "", 0, "")

@property
def id(self) -> str:
Expand Down
4 changes: 2 additions & 2 deletions src/server/downloader/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ async def _handleMessage(data: JDict) -> Optional[Dict[str, Any]]:
else:
song = Song.fromDict(data).model
self._logger.info("download custom song %s", song)
asyncio.create_task(self.downloadSong(song, True, True))
asyncio.create_task(self.downloadSong(song, True))
return {"action": "download", "status": "ok", "songId": song.id}
return {
"action": data.optionalGet("action", str),
Expand Down Expand Up @@ -197,7 +197,7 @@ async def _applyMetadata(self, filename: str, song: SongModel) -> None:
tag.save(version=eyed3.id3.ID3_V2_3)

async def downloadSong(
self, song: SongModel, forExport: bool = False, withMetadata: bool = False
self, song: SongModel, withMetadata: bool = False
) -> bool:
"""downloads a song"""
filename = Song(song).downloadPath()
Expand Down
1 change: 1 addition & 0 deletions src/server/handler/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ async def addSong(self, request: web.Request) -> web.Response:
"""post(/api/playlists/{id}/tracks)"""
id_ = str(request.match_info["id"])
jdata = await request.json()
success = False

if isinstance(jdata, list):
success = await self._playlistManager.addAllToPlaylist(
Expand Down
2 changes: 1 addition & 1 deletion src/server/meta/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from typing import Any, Dict, Optional

import validators # type: ignore
import validators

from meta.spotify import Spotify
from dataModel.track import ITrack, SoundcloudTrack, YoutubeTrack, SpotifyTrack
Expand Down
1 change: 1 addition & 0 deletions src/server/meta/scorereader.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def toJson(self) -> Dict[str, Any]:
class OneFootballMatch(Match):
"""https://www.onefootball.com/"""
def __init__(self, url: str) -> None:
nurl = ""
if "/team" in url:
nurl = OneFootballTeam.getFirstMatch(url)
if "/competition" in url:
Expand Down

0 comments on commit dc87f7b

Please sign in to comment.