Skip to content

How to only get versions of a master of a certain format #155

Answered by AnssiAhola
Lightdm asked this question in Support
Discussion options

You must be logged in to vote

It's pretty hard to figure it out from the source code, but Master.versions is actually an PaginatedList under the hood which inherits BasePaginatedResponse so it has the filter() method and should call that specific api when invoked.

Example

master = client.master(1051980)
result = master.versions.filter(format="CD")
for release in result:
    print(release)

The filter() method supports all the parameters described in the API docs and can be passed in as kwargs

result = master.versions.filter(
    master_id=123,
    page=1,
    per_page=10,
    format="Vinyl",
    label="Scorpio Music",
    released=1992,
    country="Belgium",
    sort="released",
    sort_order="asc"
)

Hope that helps,…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@JOJ0
Comment options

@Lightdm
Comment options

@AnssiAhola
Comment options

Answer selected by Lightdm
@Lightdm
Comment options

@JOJ0
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants