|
16 | 16 | import os
|
17 | 17 |
|
18 | 18 | import headphones
|
19 |
| -from headphones import db, helpers, logger, lastfm, request, mb, os |
| 19 | +from headphones import db, helpers, logger, lastfm, request, mb |
20 | 20 | from fanart.music import Artist
|
21 | 21 |
|
22 | 22 | LASTFM_API_KEY = "690e1ed3bc00bc91804cd8f7fe5ed6d4"
|
23 | 23 |
|
24 | 24 | os.environ.setdefault('FANART_APIKEY', '1f081b32bcd780219f4e6d519f78e37e')
|
25 | 25 |
|
| 26 | + |
26 | 27 | class Cache(object):
|
27 | 28 | """
|
28 | 29 | This class deals with getting, storing and serving up artwork (album art,
|
@@ -412,7 +413,7 @@ def _update_cache(self):
|
412 | 413 | artwork = request.request_content(image_url, timeout=20)
|
413 | 414 |
|
414 | 415 | if image_url and self.query_type == 'artwork':
|
415 |
| - #artwork = request.request_content(image_url, timeout=20) |
| 416 | + # artwork = request.request_content(image_url, timeout=20) |
416 | 417 |
|
417 | 418 | if artwork:
|
418 | 419 | # Make sure the artwork dir exists:
|
@@ -451,7 +452,7 @@ def _update_cache(self):
|
451 | 452 | # as it's missing/outdated.
|
452 | 453 | if thumb_url and self.query_type in ['thumb', 'artwork'] and not (
|
453 | 454 | self.thumb_files and self._is_current(self.thumb_files[0])):
|
454 |
| - #artwork = request.request_content(thumb_url, timeout=20) |
| 455 | + # artwork = request.request_content(thumb_url, timeout=20) |
455 | 456 |
|
456 | 457 | if artwork:
|
457 | 458 | # Make sure the artwork dir exists:
|
@@ -540,6 +541,7 @@ def _update_cache(self):
|
540 | 541 |
|
541 | 542 | myDB.upsert("descriptions", newValueDict, controlValueDict)
|
542 | 543 |
|
| 544 | + |
543 | 545 | def getArtwork(ArtistID=None, AlbumID=None):
|
544 | 546 | c = Cache()
|
545 | 547 | artwork_path = c.get_artwork_from_cache(ArtistID, AlbumID)
|
|
0 commit comments