Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Support random mixes without creating a radio station #263

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

Support random mixes without creating a radio station #263

wants to merge 1 commit into from

Conversation

hechtus
Copy link
Contributor

@hechtus hechtus commented May 30, 2014

This implements random mixes for artists, albums, tracks, and genres.
It is also possible to retreive artist-only mixes which is identified
by a special seedType. Artist-related mixes use the seedType 3,
whereas artist-only mixes use seedType 7.

During the development of this I identifed the seedTypes as follows:
1: My Music Track Related Mix
2: All Access Track Related Mix
3: Artist Related Mix
4: Album Related Mix
5: Genre Mix
6: I'm feeling lucky radio
7: Artist-only Mix

It seems that there is also seedType 8, but I don't know what this is.

Splitting up all kinds of mixes into separate client methods seemed to
be more intuitive than using just one. What do you think?

This implements random mixes for artists, albums, tracks, and genres.
It is also possible to retreive artist-only mixes which is identified
by a special seedType. Artist-related mixes use the seedType 5,
whereas artist-only mixes use seedType 7.
@simon-weber
Copy link
Owner

Nice!

At first I was thinking we should match create_station's params, but since artist ids can be provided for more than one mix type it gets kind of messy.

Are all of these seeds valid for creating stations as well? If so, I'd prefer to have create_station and eg create_mix to take similar arguments.

@hechtus
Copy link
Contributor Author

hechtus commented Jun 4, 2014

I was also thinking of using just a single method for creating mixes using the same parameters as create_station(). But as I'm having two options for greating an artist mix (artist-only and artist-related) I run out of ideas.

Yes, you can use all these seeds for station creation as well. You can even use this artist-only seedType:7 together with an artist ID.

@simon-weber
Copy link
Owner

Hm. This might be a bit too c-influenced, but we could push the configuration into an object that encapsulates all these restrictions. eg:

conf = MixConfig(album='an-id)  # ok
conf = MixConfig(artist='an-id', disallow_related=True)  # ok, artist-exclusive. default would be artist-related
conf = MixConfig(artist='an-id', album='another-id')  # raises an exception
...
mc.create_station(conf) # or mc.create_mix(conf)

We could also just throw all of this logic into the call itself, but I think it's probably smart to decouple it -- that'll make things more flexible to handle new seedtypes in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants