Skip to content

Commit

Permalink
Travis CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nopoz committed Jun 14, 2019
1 parent ac50641 commit 9ccd380
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions headphones/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
import os

import headphones
from headphones import db, helpers, logger, lastfm, request, mb, os
from headphones import db, helpers, logger, lastfm, request, mb
from fanart.music import Artist

LASTFM_API_KEY = "690e1ed3bc00bc91804cd8f7fe5ed6d4"

os.environ.setdefault('FANART_APIKEY', '1f081b32bcd780219f4e6d519f78e37e')


class Cache(object):
"""
This class deals with getting, storing and serving up artwork (album art,
Expand Down Expand Up @@ -412,7 +413,7 @@ def _update_cache(self):
artwork = request.request_content(image_url, timeout=20)

if image_url and self.query_type == 'artwork':
#artwork = request.request_content(image_url, timeout=20)
# artwork = request.request_content(image_url, timeout=20)

if artwork:
# Make sure the artwork dir exists:
Expand Down Expand Up @@ -451,7 +452,7 @@ def _update_cache(self):
# as it's missing/outdated.
if thumb_url and self.query_type in ['thumb', 'artwork'] and not (
self.thumb_files and self._is_current(self.thumb_files[0])):
#artwork = request.request_content(thumb_url, timeout=20)
# artwork = request.request_content(thumb_url, timeout=20)

if artwork:
# Make sure the artwork dir exists:
Expand Down Expand Up @@ -540,6 +541,7 @@ def _update_cache(self):

myDB.upsert("descriptions", newValueDict, controlValueDict)


def getArtwork(ArtistID=None, AlbumID=None):
c = Cache()
artwork_path = c.get_artwork_from_cache(ArtistID, AlbumID)
Expand Down
4 changes: 2 additions & 2 deletions headphones/lastfm.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ def request_lastfm(method, **kwargs):
if not data:
logger.error("Error calling Last.FM method: %s", method)
# when there is a last.fm api fail, this return prevents artist artwork from loading
#return
# return

if "error" in data:
logger.debug("Last.FM returned an error: %s", data["message"])
# when there is a last.fm api fail, this return prevents artist artwork from loading
#return
# return

return data

Expand Down

0 comments on commit 9ccd380

Please sign in to comment.