Re-enable Last.fm similar tag cloud

This commit is contained in:
rembo10
2022-11-12 16:44:01 +05:30
parent fcf59a9b38
commit 9add571886
3 changed files with 10 additions and 10 deletions

View File

@@ -102,13 +102,7 @@ def artistlist_to_mbids(artistlist, forced=False):
myDB.action('DELETE from newartists WHERE ArtistName=?', [artist])
# Update the similar artist tag cloud:
# TODO: Fix last.fm api
# logger.info('Updating artist information from Last.fm')
# try:
# lastfm.getSimilar()
# except Exception as e:
# logger.warn('Failed to update artist information from Last.fm: %s' % e)
lastfm.getSimilar()
def addArtistIDListToDB(artistidlist):

View File

@@ -62,6 +62,13 @@ def request_lastfm(method, **kwargs):
def getSimilar():
if not headphones.CONFIG.LASTFM_APIKEY:
logger.info(
'To update the Similar Artists cloud tag, create a Last.fm application api key '
'and add it under the Advanced config tab'
)
return
myDB = db.DBConnection()
results = myDB.select("SELECT ArtistID from artists ORDER BY HaveTracks DESC LIMIT 10")

View File

@@ -442,9 +442,8 @@ def libraryScan(dir=None, append=False, ArtistID=None, ArtistName=None,
# if not append:
# update_album_status()
# TODO: Fix last.fm api calls
#if not append and not artistScan:
#lastfm.getSimilar()
if not append and not artistScan:
lastfm.getSimilar()
if ArtistName:
logger.info('Scanning complete for artist: %s', ArtistName)