Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of 'Favorite Songs' playlist #159

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shafreeck
Copy link

Description

This PR fixes a crash that occurs when downloading the 'Favorite Songs' playlist. The issue arises because this automatically generated playlist lacks the curatorName attribute, which was previously accessed directly.

Changes

  • Modified get_playlist_tags() to handle missing curatorName attribute
  • Set default curator to 'Apple Music' for system playlists
  • Improved error handling for playlist metadata

Code Changes

def get_playlist_tags(self, playlist_attributes: dict, playlist_track: int) -> dict:
    tags = {
        "playlist_artist": playlist_attributes.get("curatorName", "Apple Music"),
        "playlist_id": playlist_attributes["playParams"]["id"],
        "playlist_title": playlist_attributes["name"],
        "playlist_track": playlist_track,
    }
    return tags

Testing

  • Tested with 'Favorite Songs' playlist
  • Verified compatibility with regular playlists
  • Ensured playlist metadata is correctly saved

'Favorite Songs' is an automatically generated playlist by
Apple Music that lacks the curatorName attribute. Set the
default curator to 'Apple Music' to maintain consistency
with other system playlists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant