Skip to content

Commit 233ff0a

Browse files
authored
Merge pull request #167 from 0xAnansi/main
[Fix] Improve handling of albumId in queued_album_ids
2 parents c5420c0 + de3a645 commit 233ff0a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

soularr.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,6 @@ def grab_most_wanted(albums):
609609
if os.path.exists(folder):
610610
shutil.rmtree(folder)
611611

612-
613-
614612
elif os.path.exists(folder):
615613
shutil.move(folder,artist_name_sanitized)
616614

@@ -765,7 +763,13 @@ def get_records(missing: bool) -> list:
765763
current_queue.extend(next_page['records'])
766764
page += 1
767765

768-
queued_album_ids = [record['albumId'] for record in current_queue]
766+
queued_album_ids = []
767+
for record in current_queue:
768+
if 'albumId' in record:
769+
queued_album_ids.append(record['albumId'])
770+
else:
771+
logger.warning(f"Dropping entry due to missing key in keylist: [{record.keys()}]")
772+
769773
wanted_records_not_queued = []
770774
for record in wanted_records:
771775
for release in record['releases']:

0 commit comments

Comments
 (0)