hi! i have an API question re: a script I'm developing for personal use
is there a way to A. get artist-credit-phrase info on release groups when fetching a collection, and B. get artist-credit-phrase and first-release-date info on recordings when fetching a collection?
mayhem
reosarevok: bitmap ^^
I trust you're talking about using the API, yes, GibusWearingMann ?
GibusWearingMann
Yes mayhem
mayhem
it sounds like your data needs are pretty specific.
reosarevok
GibusWearingMann: hi! mostly unrelated, but we saw you hit a bug with trying to order release group collections by artist, heh, I wrote a patch for that now
mayhem
!m reosarevok
BrainzBot
You're doing good work, reosarevok!
mayhem
GibusWearingMann: aside from that one bug, you might consider installing a copy of the MB db and using SQL to get the data.
reosarevok: I wasn't actually expecting that URL tweak to work, since the collection page doesn't have a sort button on that field
reosarevok
Yeah, that was *another* bug, heh
GibusWearingMann
That was a different thing anyway, lol
reosarevok
We actually had that (badly) implemented, but without the arrow for some reason :D I'm fixing both, thanks for breaking our site!
mayhem
lol
bitmap
GibusWearingMann: hey, I'd recommend trying a release group browse request with the collection ID, like /ws/2/release-group/?collection=<id>&inc=artist-credits
GibusWearingMann
I saw it was like ?sort=title and ?sort=date, so I was like hey i wonder if ?sort=artist secretly works even though there isn't a button
I *think* the same with recordings should work and we should return the first-release-date info there
GibusWearingMann
I'm using the musicbrainzngs python frontend, but I've been modifying its internals for my app since it doesn't appear to be maintained
I'll try including "artist-credits" in release group fetches, one sec
*collection fetches
mayhem
nominally it is, but its not a priority for us. the JSON API is so damn easy to use...
reosarevok
I expect if you submit some patches, they'll eventually get reviewed and possibly merged, is what I think mayhem means, but we might never get to it ourselves otherwise :p
GibusWearingMann
there are already open PRs for some of what I tweaked that have been open since January
reosarevok
alastairp: ^ :p
mayhem
heh, yes
GibusWearingMann
i just speak Python and no other langs so that's why
mayhem
GibusWearingMann: you should pester alastairp to look at those.
he's also poke driven. poke him.
reosarevok
Every day. Every hour.
(ok, not that often)
GibusWearingMann
bitmap: "artist-credits" is giving me http 400 bad request. i'll see if i can debug what url it's actually trying
bitmap
hrm okay
GibusWearingMann
wait why the heck is it doing "collection/041da5f0-dcdd-4996-9107-feb121534e7e/release-groups"
yeah it's trying to fetch /ws/2/collection/[id]/release-groups?inc=artist-credits
bitmap
oh, that's actually a valid API call, but it will return less info (and I'm not sure paging or any 'inc' parameters work)
GibusWearingMann
let me remove the include and see if that's just what it normally does
bitmap
that's why we added browsing by collection id, but maybe the browsing functionality never made its way into py-musicbrainzngs
GibusWearingMann
seems it hasn't, it's still using collection/id/type
reosarevok
GibusWearingMann: are you trying to call a collection or a release group?
GibusWearingMann
a collection
reosarevok
This works by calling the release groups API, but with the collection MBID as a parameter
GibusWearingMann
a collection of release groups, or of recordings
reosarevok
So if you're calling the collection API via the library, maybe try to call release-group or whatnot instead
(sorry, I haven't really played with the library in years, so I'm guessing rn)
GibusWearingMann
if i just change the constructed api call to collection/id?includes will that work directly?
reosarevok
GibusWearingMann: you want browse_release_groups but it might not accept collection right now
add browsing other entities by collection as far as i can see
i haven't reviewed any of these in detail so idk if they work
also thanks everyone for saving my app API calls for each individual item in my collections! i'm planning to use this on fairly large collections so that's literally thousands of potential calls removed
(i want to convert acclaimedmusic's top of all time lists into a custom timeline format using musicbrainz's release dates)
reosarevok
GibusWearingMann: yay :) Feel free to come back with more questions as needed!
bitmap
no clue, let me see if I can trigger them somehow...
alastairp
thanks for the prod, GibusWearingMann. I'll see if I can gather some motivation to make a new release this week
GibusWearingMann
also i fixed my _get_auth_type hack from just always returning AUTH_YES to adding "'collection' in includes" to the includes condition
so that is something that works and also keeps existing behavior
now if only acclaimedmusic linked to musicbrainz instead of rym
aerozol
Mayhem: amazing, see you at the bus stop! I was among a loot of upset children this last flight, hopefully I can sleep on this one. Shout out to the guy in front of me who chewed his nails like a buzzsaw. Not really annoying but strangely distracting
alastairp
aerozol: half way?! see you soon!
aerozol
alastairp: 🎉
P.s. I will let everyone else judge whether I need a shower before the Airbnb is open :D
Maybe I will watch movies this next flight. Like the director intended, on a tiny scratched screen with lots of reflections
reosarevok
Seems slightly less annoying than editing MB on a tiny screen
BrainzGit
[bookbrainz-site] 14dependabot[bot] opened pull request #886 (03master…dependabot/npm_and_yarn/babel/core-7.19.3): chore(deps-dev): bump @babel/core from 7.16.0 to 7.19.3 https://github.com/metabrainz/bookbrainz-site/p...
[bookbrainz-site] 14dependabot[bot] closed pull request #882 (03master…dependabot/npm_and_yarn/babel/core-7.19.1): chore(deps-dev): bump @babel/core from 7.16.0 to 7.19.1 https://github.com/metabrainz/bookbrainz-site/p...
aerozol
Haha I don't know if there's much that's worse than editing MB on a phone to be fair
aerozol: if you need/want shower/bed before the bnb opens, no problem to accomodate
aerozol
Awesome thanks, mayhem offered as well <3
alastairp
"no problem for mayhem to accomodate"
GibusWearingMann
oh also alastairp could you *please* standardize tabs and spaces in your code? vs code keeps yelling at me :(
some functions use tabs and some use spaces
alastairp
GibusWearingMann: yeah, this was started something like 15 years ago when tabs were a good idea
and we slowly decided to migrate to spaces, but "only when we touch a function"
but I think that's silly, and I should just do a wholesale migration and call it done
GibusWearingMann
also apparently my auth type hack from earlier doesn't work, and can't work, because the information that we're doing a type/?collection call doesn't even get passed in
because the ?collection= is in params
and up until this point no params have ever affected auth but this one does
oh by the way reosarevok re: browsing a collection on the website: is there a way to group all types in the collection in the same list, instead of having separate lists for "Album", "Album, Live", "Album, Compilation" etc? that would make copying in a list from another website much easier since i could just sort both alphabetically and not have to
worry if i missed one
BrainzGit
[musicbrainz-server] 14mwiencek opened pull request #2671 (03master…rel-editor-userscript-helpers): Help userscripts integrate with the relationship editor, pt. 2 https://github.com/metabrainz/musicbrainz-serve...
reosarevok
IIRC not right now
bitmap: that PR seems sensible to me, you can always merge so kellnerd can test in beta if you want