Skip to content

Commit

Permalink
Fix #64
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalec committed Mar 21, 2022
1 parent a7b09cd commit 0f5f33e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deemon/cmd/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,10 @@ def process_artist_by_id(i):
queue_filtered_releases(artist_id_result)

def process_album_by_id(i):
logger.debug("Processing album by name")
logger.debug("Processing album by ID")
album_id_result = get_api_result(album_id=i)
if not album_id_result:
logger.debug(f"Album ID {i} was not found")
return
logger.debug(f"Requested Album: {i}, "
f"Found: {album_id_result['artist']['name']} - {album_id_result['title']}")
Expand Down
10 changes: 10 additions & 0 deletions deemon/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ def get_artist_by_id(self, query: int, limit: int = 1) -> dict:

def get_album(self, query: int) -> dict:
"""Return a dictionary from API containing album info"""
if self.platform == "deezer-gw":
try:
result = self.api.get_album(query)
except deezer.errors.GWAPIError as e:
logger.debug(f"API error: {e}")
return {}
return {'id': int(result['ALB_ID']), 'title': result['ALB_TITLE'], 'artist': {'name': result['ART_NAME']}}
else:
logger.warning("Please enable the fast_api for album downloads")
return {}

def get_extra_release_info(self, query: dict):
album = {'id': query['album_id'], 'label': None}
Expand Down

0 comments on commit 0f5f33e

Please sign in to comment.