Skip to content

Commit

Permalink
minor linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
teticio committed Oct 15, 2021
1 parent 61774c1 commit 095da98
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions backend/deejai.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ async def playlist(self, track_ids, size, creativity, noise):
size=size,
noise=noise)

async def most_similar(
self, # pylint: disable=too-many-arguments
async def most_similar( # pylint: disable=too-many-arguments
self,
mp3tovecs,
weights,
positive=iter(()),
Expand Down Expand Up @@ -142,8 +142,8 @@ async def most_similar(
del result[result.index(i)]
return result

async def most_similar_by_vec(
self, # pylint: disable=too-many-arguments
async def most_similar_by_vec( # pylint: disable=too-many-arguments
self,
mp3tovecs,
weights,
positives=iter(()),
Expand Down Expand Up @@ -197,8 +197,8 @@ async def join_the_dots(self, weights, ids, size=5, noise=0):
playlist.append(end)
return playlist

async def make_playlist(
self, # pylint: disable=too-many-arguments
async def make_playlist( # pylint: disable=too-many-arguments
self,
weights,
playlist,
size=10,
Expand Down
30 changes: 15 additions & 15 deletions backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@
from fastapi_cache.backends.redis import RedisBackend
from fastapi_cache.coder import JsonCoder

if 'NO_CACHE' not in os.environ:
from fastapi_cache.decorator import cache
else:

def cache(**kwargs): # pylint: disable=unused-argument
"""Override cache decorator
"""
def do_nothing(func):
"""Don't cache
"""
return func

return do_nothing


from sqlalchemy import desc, event
from sqlalchemy.orm import Session
from sqlalchemy.exc import IntegrityError, SQLAlchemyError
Expand All @@ -53,6 +38,21 @@ def do_nothing(func):
from .deejai import DeejAI
from .database import SessionLocal, engine

if 'NO_CACHE' not in os.environ:
from fastapi_cache.decorator import cache # pylint: disable=ungrouped-imports
else:

def cache(**kwargs): # pylint: disable=unused-argument
"""Override cache decorator
"""
def do_nothing(func):
"""Don't cache
"""
return func

return do_nothing


credentials.REDIRECT_URL = os.environ.get('SPOTIFY_REDIRECT_URI',
credentials.REDIRECT_URL)
REDIS_URL = os.environ.get('REDIS_URL', 'redis://localhost')
Expand Down

0 comments on commit 095da98

Please sign in to comment.