From f4d60226b3b35fba2dcd8f263dba1a36c6749a83 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Tue, 8 Feb 2022 19:37:33 +0530 Subject: [PATCH] Disable last.fm getSimilar --- headphones/lastfm.py | 4 ++-- headphones/librarysync.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/headphones/lastfm.py b/headphones/lastfm.py index a0eb70a4..969e0e99 100644 --- a/headphones/lastfm.py +++ b/headphones/lastfm.py @@ -63,12 +63,12 @@ def request_lastfm(method, **kwargs): def getSimilar(): myDB = db.DBConnection() - results = myDB.select("SELECT ArtistID from artists ORDER BY HaveTracks DESC") + results = myDB.select("SELECT ArtistID from artists ORDER BY HaveTracks DESC LIMIT 10") logger.info("Fetching similar artists from Last.FM for tag cloud") artistlist = [] - for result in results[:12]: + for result in results: data = request_lastfm("artist.getsimilar", mbid=result["ArtistId"]) if data and "similarartists" in data: diff --git a/headphones/librarysync.py b/headphones/librarysync.py index e369fedd..86715514 100644 --- a/headphones/librarysync.py +++ b/headphones/librarysync.py @@ -442,8 +442,9 @@ def libraryScan(dir=None, append=False, ArtistID=None, ArtistName=None, # if not append: # update_album_status() - if not append and not artistScan: - lastfm.getSimilar() + # TODO: Fix last.fm api calls + #if not append and not artistScan: + #lastfm.getSimilar() if ArtistName: logger.info('Scanning complete for artist: %s', ArtistName)