#metabrainz

/

      • wargreen has quit
      • GibusWearingMann joined the channel
      • GibusWearingMann
        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.
      • https://github.com/metabrainz/musicbrainz-docker makes this pretty easy, as long as your have space to run it and some time to wait for it to get setup
      • GibusWearingMann
        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
      • reosarevok
        Anyway, isn't what you want just https://beta.musicbrainz.org/ws/2/release-group... ?
      • Yeah, what bitmap said :D
      • bitmap
        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
      • The docs now say just
      • musicbrainzngs.browse_release_groups(artist=None, release=None, release_type=[], includes=[], limit=None, offset=None)
      • GibusWearingMann
        i see
      • reosarevok
        So I guess it supports artist or release but not collection
      • I'd expect changing that involves literally adding "collection" in the same way it does "artist"
      • GibusWearingMann
        i'll see if i can hack the browse functions for release groups and recordings to accept collections
      • reosarevok
        If you can, I suspect that plus the artist-credits include would give you what you want
      • If not, again, pester alastairp about it :)
      • alastairp
        ah, those pull requests
      • yeah, I look at them from time to time, and then it all feels like too much and I ignore them tagain
      • GibusWearingMann
        ok now it's building a url that looks like release-group/?collection=id
      • reosarevok
        That looks more legit
      • GibusWearingMann
        and now i'm getting http 401 unauthorized even though i authed
      • alastairp
        reosarevok: if you were here this week you could have pestered me about it
      • BrainzGit
        [musicbrainz-server] 14reosarevok merged pull request #2668 (03master…MBS-12645): MBS-12645: Add guess case to genre edit form https://github.com/metabrainz/musicbrainz-serve...
      • GibusWearingMann
        i'm trying to fetch one of my own private collections, is that a different case?
      • reosarevok
        bitmap: I think you could merge https://github.com/metabrainz/musicbrainz-serve... and release a beta maybe? Or I can do it tomorrow
      • BrainzGit
        [musicbrainz-server] 14mwiencek merged pull request #2664 (03master…mbs-12629): MBS-12629: Adding new instrument doesn't clear type-info cache https://github.com/metabrainz/musicbrainz-serve...
      • reosarevok
        GibusWearingMann: huh. I'd *expect* that to work, but I haven't tested it - does it work if you do https://musicbrainz.org/ws/2/release-group?coll... directly?
      • bitmap
        reosarevok: I'm about to submit a PR for MBS-12646 which would be nice to include too
      • BrainzBot
        MBS-12646: Beta: Can't change time on artist-event rel https://tickets.metabrainz.org/browse/MBS-12646
      • reosarevok
        Oh, certainly
      • I can quickly review that
      • https://github.com/metabrainz/musicbrainz-serve... makes sense IMO too but maybe yvanzo wants to take a look first
      • bitmap
        give me a couple minutes to clean up the commits
      • GibusWearingMann
        reosarevok: yes, that works in browser
      • maybe the python lib is failing to auth a function it should be authing?
      • reosarevok
        Maybe. alastairp, would you happen to know?
      • alastairp
        it's been a while since I looked at that code, I think it auths for all collections requests if you've called the auth method
      • GibusWearingMann
        yes, except this is a release-group request with a collection include
      • alastairp
        ah, right. in that case I don't think it will, sorry
      • GibusWearingMann
        i'll hack _get_auth_type to just always auth
      • and now it works!
      • alastairp
        great
      • GibusWearingMann: from you can see, that collections PR should also fix this? let me see if I can look at it this week during our summit
      • GibusWearingMann
        what PR should i look at?
      • alastairp
        sorry - I thought I read above that you said you found an unmerged PR that implemented it?
      • GibusWearingMann
        there were a couple different ones, i'll find them, one sec
      • BrainzGit
        [musicbrainz-server] 14mwiencek opened pull request #2670 (03master…mbs-12646): MBS-12646: Can't change time on artist-event relationship https://github.com/metabrainz/musicbrainz-serve...
      • GibusWearingMann
        alastairp: https://github.com/alastair/python-musicbrainzn... adds get_release_groups_in_collection (incorrectly, i left a code review), https://github.com/alastair/python-musicbrainzn... adds first-release-date parsing to recordings, and https://github.com/alastair/python-musicbrainzn... adds browse_collections but doesn't
      • 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
      • reosarevok
        bitmap: huh, how comes https://github.com/metabrainz/musicbrainz-serve... is not running perl tests?
      • GibusWearingMann
        (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
      • BrainzGit
        [musicbrainz-server] 14reosarevok merged pull request #2666 (03beta…MBS-12639): MBS-12639: Also update countries.pot from the DB https://github.com/metabrainz/musicbrainz-serve...
      • alastairp
        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
      • aerozol
        Should I get a pricey power plug adaptor from the airport? Or are there some about the office. I still have plenty of juice for now
      • reosarevok
        alastairp was offering earlier
      • aerozol
        Yeah I have a surface unfortunately, they were offering laptop cables right
      • I'll leave it for now I assume there are stores in Barcelona also :)
      • alastairp
        aerozol: what laptop do you have?
      • I'll bring at least one plug adapter to the office, and otherwise we might be able to provide other cables that can charge
      • ah, i see that a surface has weird cables. I'm sure we'll sort something out
      • GibusWearingMann has quit
      • GibusWearingMann joined the channel
      • aerozol
        A plug adapter would be great - I’ll mainly need it if we call into the livestream via my lappy, let’s see
      • Yay for proprietary cables >.>
      • GibusWearingMann
        is a metabrainz event happening or is this something else?
      • atj
        aerozol: are you flying Christchurch to Melbourne to Abu Dhabi to Barcelona?
      • BrainzGit
        [musicbrainz-server] 14mwiencek merged pull request #2670 (03master…mbs-12646): MBS-12646: Can't change time on artist-event relationship https://github.com/metabrainz/musicbrainz-serve...
      • mayhem
        aerozol: we've got loads of cheap chinese goods stores that sell these things for cheap. if you can make it, we can buy one tomorrow. cake.
      • GibusWearingMann: our (normally) annual summit starts this week. people are flying in from new zealand, india, chicago and points in the EU.
      • all converging on Barcelona and the metabrainz office here.
      • aerozol
        atj: yup!
      • GibusWearingMann
        cool! have fun
      • atj
        aerozol: that is hardcore. London to Dubai to Auckland is bad enough!