danbiwer/discogs-marketplace-js

Trying to make it happen

Closed this issue · 6 comments

Hi,

Black Sabbath example drops

SyntaxError: Invalid shorthand property initializer

Filter example drops nothing.

If I remove most of the filters and change the id to 5902232 that's the most I can get:

{ pagination: { items: 0, hasNext: false, totalPages: 0 },
  listing: [],
  id: '5902232',
  type: 'release' }

What am I doing wrong?

You may have caught this, but I made a mistake in the Black Sabbath example. I should have been using colons instead of equal signs.
So the fixed example should look like this:

var market = require("discogs-marketplace-js");

var search_parameters = {
	id: "Black Sabbath",
	type: "string",
	pagination : {
		page: 1
	}
}

market.search(search_parameters, function(result){
	console.log(result);
})

I just tested the above code, and it returned the expected result.

If that doesn't work for you, are you using the latest version? The "search" method is new to v2, and replaces the now deprecated (but hopefully still backwards compatible) "searchByID" and "searchByString".

Cheers, all good! Search for string is fine, for release it still drops empty.

It looks like there are no albums in the marketplace with that release ID, so it's returning an empty list. I should probably update the method to return null in that case.

Should it work only for albums? The release ID is valid.

https://www.discogs.com/Jeff-Mills-Kat-Moda-EP/release/5902232

ty, good catch!