0

我有以下代码返回所有结果(和所有类型)

import musicbrainzngs
result = musicbrainzngs.browse_release_groups("cc2c9c3c-b7bc-4b8b-84d8-4fbd8779e493")

我只想通过设置release_type=[]列表过滤 API 与代码中的结果并将其他所有内容都扔掉

release_type=['album', 'live', 'single']
result = musicbrainzngs.browse_release_groups("cc2c9c3c-b7bc-4b8b-84d8-4fbd8779e493", release_type=release_type)

)

问题是,这段代码只给了我“live & single”版本..即使我也指定album了......

{'release-group-list': [{'first-release-date': '2011-11-25',
                         'id': '36e41dc0-2a0c-4ff7-b043-097534d52bf6',
                         'title': 'Adele Live at the Royal Albert Hall',
                         'type': 'Live'},
                        {'first-release-date': '2011',
                         'id': '37367c39-1c91-4a8c-baa7-0a09c3df4b6b',
                         'title': '2011-02-25: Morning Becomes Eclectic, KCRW-FM, Santa Monica, CA, USA',
                         'type': 'Live'},
                        {'first-release-date': '2012-10-05',
                         'id': '4307ecf9-d0f2-4b95-b7ad-2f8cba84a5e9',
                         'title': 'Skyfall',
                         'type': 'Single'},
                        {'first-release-date': '2011-04-28',
                         'id': 'c9ddd0ed-ba23-4dfc-bb7e-42f8ffb21fb7',
                         'title': '2011-04-08: Paradiso FM, Amsterdam, Netherlands',
                         'type': 'Live'}]}

而且我确实有type='Album'不使用release_typeie 的版本:

{
  'first-release-date': '2011-07-13',
  'id': '763f800f-4284-432b-b056-7f6e0aa26bfe',
  'title': 'iTunes Festival: London 2011',
  'type': 'EP'
},
{
  'first-release-date': '2011-07-04',
  'id': '7c2071cb-598d-4a0c-b1d5-a53e2cb9b5f8',
  'title': 'Set Fire to the Rain',
  'type': 'Single'
},
{
  'first-release-date': '2008-01-27',
  'id': '9796da06-2d59-3176-8598-2105f31ee54a',
  'title': '19',
  'type': 'Album'
},

编辑2

release_type=['album']当我使用(不带live& )时,结果非常奇怪single- 我现在收到专辑和现场类型(?!?!)

release_type=['album']
result = musicbrainzngs.browse_release_groups("cc2c9c3c-b7bc-4b8b-84d8-4fbd8779e493", release_type=release_type)

{'release-group-list': [{'first-release-date': '2011-11-25',
                         'id': '36e41dc0-2a0c-4ff7-b043-097534d52bf6',
                         'title': 'Adele Live at the Royal Albert Hall',
                         'type': 'Live'},
                        {'first-release-date': '2011',
                         'id': '37367c39-1c91-4a8c-baa7-0a09c3df4b6b',
                         'title': '2011-02-25: Morning Becomes Eclectic, KCRW-FM, Santa Monica, CA, USA',
                         'type': 'Live'},
                        {'first-release-date': '2008-01-27',
                         'id': '9796da06-2d59-3176-8598-2105f31ee54a',
                         'title': '19',
                         'type': 'Album'},
                        {'first-release-date': '2012',
                         'id': 'ad1343e8-1832-4035-8dcc-0bed2daa5ace',
                         'title': 'Greatest Hits',
                         'type': 'Compilation'},
                        {'first-release-date': '2011-04-28',
                         'id': 'c9ddd0ed-ba23-4dfc-bb7e-42f8ffb21fb7',
                         'title': '2011-04-08: Paradiso FM, Amsterdam, Netherlands',
                         'type': 'Live'},
                        {'first-release-date': '2011-01-19',
                         'id': 'e4174758-d333-4a8e-a31f-dd0edd51518e',
                         'title': '21',
                         'type': 'Album'}]}

知道为什么吗?

4

0 回答 0