#metabrainz

/

      • lucifer
        I got my spotify extended streaming history recently and it has timestamp to the second so we can use it to backfill listen history like lfm :)
      • 2022-01-12 01250, 2022

      • CatQuest
        also, probably for whatyou're doing with mayhem right now. I haven't read backlog but it's probably 👍 anyway :D
      • 2022-01-12 01213, 2022

      • mayhem
        grrrr. second resolution. mutherfuckers.
      • 2022-01-12 01248, 2022

      • lucifer
        oh! issues with that?
      • 2022-01-12 01242, 2022

      • mayhem
        what resolution do we get from their API? its less than second, no?
      • 2022-01-12 01243, 2022

      • lucifer
        they are not well intentions for sure, because the automated download is timestamp to the minute but you need to email to get timestamp to the second.
      • 2022-01-12 01253, 2022

      • mayhem
        ah, ok.
      • 2022-01-12 01201, 2022

      • mayhem
        then its all good.
      • 2022-01-12 01203, 2022

      • lucifer
        we get millisecond from API
      • 2022-01-12 01204, 2022

      • mayhem
        still evil.
      • 2022-01-12 01220, 2022

      • lucifer
        round it off to second for use in LB then.
      • 2022-01-12 01224, 2022

      • lucifer
        yes indeed.
      • 2022-01-12 01227, 2022

      • mayhem
        ah, that. they have ms. and are only willing to give second.
      • 2022-01-12 01252, 2022

      • mayhem
        they are not giving you everything they have on your own data.
      • 2022-01-12 01247, 2022

      • lucifer
        yeah indeed.
      • 2022-01-12 01222, 2022

      • lucifer
        re what we have currently, seconds is good enough for now?
      • 2022-01-12 01244, 2022

      • mayhem
        yeah.
      • 2022-01-12 01206, 2022

      • lucifer
        nice so thee issue is the json file has PII.
      • 2022-01-12 01225, 2022

      • lucifer
        see the stream info in PR description
      • 2022-01-12 01251, 2022

      • lucifer
        so we may not want to process this on the backend but do it client side. thoughts?
      • 2022-01-12 01210, 2022

      • mayhem
        meaning that the browser filters out PII and only sends listens to the server? yes, that is wise.
      • 2022-01-12 01222, 2022

      • lucifer
        yes
      • 2022-01-12 01248, 2022

      • lucifer
        my intent was to do LFM importer like for this. read the json file in browser use the submit listen endpoint.
      • 2022-01-12 01207, 2022

      • lucifer
        the only concern is the current LFM importer is source of constant trouble.
      • 2022-01-12 01256, 2022

      • mayhem
        I see this as an opportunity to start over on this. and implement this with an eye towards being able to do it from a number of sources.
      • 2022-01-12 01214, 2022

      • lucifer
        however if we do this, there is one thing different from LFM importer. there's no LFM variable so if something goes wrong, its only LB side issues.
      • 2022-01-12 01259, 2022

      • lucifer
        sounds good to me.
      • 2022-01-12 01213, 2022

      • mayhem
        not sure I understand.
      • 2022-01-12 01229, 2022

      • lucifer
        with the LFM importer, issues can be either on LFM side or on LB side.
      • 2022-01-12 01254, 2022

      • lucifer
        here there's no LFM api to be called only a local file to be read.
      • 2022-01-12 01212, 2022

      • mayhem
        GDPR request sent off.
      • 2022-01-12 01225, 2022

      • lucifer
        nice
      • 2022-01-12 01233, 2022

      • mayhem
        good, then one less thing to go wrong. seems ok to me.
      • 2022-01-12 01226, 2022

      • lucifer
        cool. we should also documentation on this on how to reach out to spotify to get this data so on.
      • 2022-01-12 01236, 2022

      • lucifer
        that's it for this one.
      • 2022-01-12 01213, 2022

      • lucifer
        next there's https://github.com/metabrainz/listenbrainz-server… but that is mostly asking for a review in general
      • 2022-01-12 01259, 2022

      • mayhem
        ok, will do that.
      • 2022-01-12 01206, 2022

      • lucifer
        👍
      • 2022-01-12 01208, 2022

      • lucifer
        there's also https://github.com/metabrainz/listenbrainz-server… but we need to wait for mbid support in feedback so ignore for now.
      • 2022-01-12 01244, 2022

      • lucifer
        that's it for now.
      • 2022-01-12 01247, 2022

      • lucifer
        thanks!
      • 2022-01-12 01257, 2022

      • mayhem
        np. thanks for pounding out all this stuff!
      • 2022-01-12 01236, 2022

      • lucifer
        :D
      • 2022-01-12 01210, 2022

      • lucifer
      • 2022-01-12 01222, 2022

      • mayhem
        I see the spotify_mapping table has a recording_msid field. Why MSID?
      • 2022-01-12 01223, 2022

      • lucifer
        with this we should be able to re run for last year
      • 2022-01-12 01251, 2022

      • lucifer
        my intent was that use msid for it. then go through msid->mbid mapping when we want mbid.
      • 2022-01-12 01214, 2022

      • lucifer
        because msid->mbid will improve continously. and some mappings may improve later on.
      • 2022-01-12 01222, 2022

      • alastairp
        yeah, great work over the break lucifer!
      • 2022-01-12 01222, 2022

      • mayhem
        I would need to make a corresponding YIM PR for the playlists for them to be repeatable, but no biggie.
      • 2022-01-12 01258, 2022

      • mayhem
        I need to ponder the spotify mapping a bit more.
      • 2022-01-12 01217, 2022

      • lucifer
        i have a use case for it. import loved tracks and playlist from spotify.
      • 2022-01-12 01238, 2022

      • lucifer
        makes sense
      • 2022-01-12 01232, 2022

      • lucifer
        oh! while we are here. i and alastairp had a brief chat on the LFM imports situation.
      • 2022-01-12 01205, 2022

      • lucifer
        so the YIM stuff revealed that a lot of people regularly submit to LFM but occasionally import to LB.
      • 2022-01-12 01239, 2022

      • lucifer
        this doesn't seem ideal. should we do something about this?
      • 2022-01-12 01257, 2022

      • mayhem
        > i have a use case for it. import loved tracks and playlist from spotify.
      • 2022-01-12 01209, 2022

      • mayhem
        this is for using MSID in the spotify mapping?
      • 2022-01-12 01241, 2022

      • lucifer
        no just having the mapping in general. basically being able to go from spotify track uri to msid/mbid
      • 2022-01-12 01210, 2022

      • mayhem
        I feel very strongly that we should never build anything new on MSID.
      • 2022-01-12 01239, 2022

      • mayhem
        it should always be MBIDs going forward. so unless we can find a use case that absolutely requires it, we should be using MBID
      • 2022-01-12 01222, 2022

      • lucifer
        i am not against that but we don't know how future mapping improvements will change msid to mbid. so i think it might be useful to keep msids around just for the sake of it till we have more clarity.
      • 2022-01-12 01201, 2022

      • lucifer
        plus say a bug causes msid mbid to be wrong and we later fix that, having the msid around lets propogate those fixes elsewhere.
      • 2022-01-12 01242, 2022

      • lucifer
        in the end we may end up not needing it anywhere but this feels like a low cost to bear especially for non user facing features.
      • 2022-01-12 01209, 2022

      • mayhem
        I'm not suggesting we get rid of MSIDs -- I'm just saying that we should always build new stuff for MBIDs, unless it is absolutely clear that we need to use MSIDs.
      • 2022-01-12 01203, 2022

      • lucifer
        right i agree.
      • 2022-01-12 01237, 2022

      • mayhem
        wrt to yim and lfm and imports. that pattern was pretty clear and is fine. doing anything about it would feel like coercion. the thing we should do is make LB much more attractive than LFM.
      • 2022-01-12 01245, 2022

      • lucifer
        makes sense.
      • 2022-01-12 01222, 2022

      • lucifer
        i was pondering if a continous importer like we have for spotify would be useful. setup it once and forget.
      • 2022-01-12 01225, 2022

      • alastairp
        lucifer had a suggestion to set up the lastfm importer like we have spotify - always running in the background (server-based, not browser-based) and continually updating people's listens. I don't think this is a good idea because it encourages people to keep treating lfm as the primary data source
      • 2022-01-12 01230, 2022

      • alastairp
        oh snap
      • 2022-01-12 01235, 2022

      • lucifer
        hah
      • 2022-01-12 01213, 2022

      • mayhem ponders
      • 2022-01-12 01210, 2022

      • mayhem
        is this an opportunity to get rid of the current LFM importer, which is nothing but drama?
      • 2022-01-12 01213, 2022

      • mayhem
        if so, then YESS
      • 2022-01-12 01228, 2022

      • lucifer
        heh that's one incentive too.
      • 2022-01-12 01233, 2022

      • alastairp
        yes, right
      • 2022-01-12 01248, 2022

      • mayhem
        but, we need to get more intelligent about our importers.
      • 2022-01-12 01253, 2022

      • lucifer
        but keep in mind, we are adding another client based importer for the extended spotify importer.
      • 2022-01-12 01205, 2022

      • mayhem
        7 minutes to do an import where most users import nothing is not very intelligent.
      • 2022-01-12 01222, 2022

      • mayhem
        could we avoid that?
      • 2022-01-12 01227, 2022

      • alastairp
        technically I don't thing there are any negatives to the suggestion - we made the original importer browser-based in order to prevent possible issues with bulk API queries to lfm. but given their feedback when we were spamming requests with a single API key shows that this isn't a concern
      • 2022-01-12 01250, 2022

      • mayhem
        could we have two background importers running? one for long term one for real time?
      • 2022-01-12 01252, 2022

      • lucifer
        fwiw with LFM that isn't issue. LFM allows us to query stuff till the start of the user's history.
      • 2022-01-12 01204, 2022

      • mayhem
        exactly.
      • 2022-01-12 01209, 2022

      • lucifer
        with spotify if we stop, we may miss listens because we can only get last 50.
      • 2022-01-12 01224, 2022

      • alastairp
        yes, for spotify I think we can make the importer smarter to reduce time between updates
      • 2022-01-12 01235, 2022

      • mayhem
        agreed.
      • 2022-01-12 01215, 2022

      • alastairp
        I would probably treat them as 2 different importers - spotify_importer, lastfm_importer?
      • 2022-01-12 01232, 2022

      • mayhem
        with loads of shared code, I hope
      • 2022-01-12 01249, 2022

      • lucifer
        yes should be possible
      • 2022-01-12 01227, 2022

      • lucifer
        so LFM importer frontend goes away, we add one like spotify one for it.
      • 2022-01-12 01236, 2022

      • mayhem
        yeah
      • 2022-01-12 01239, 2022

      • lucifer
        👍
      • 2022-01-12 01249, 2022

      • alastairp
        yeah, only the "get listens from service" code would be differnt in that case
      • 2022-01-12 01259, 2022

      • mayhem
        ding
      • 2022-01-12 01219, 2022

      • alastairp
        hey, it could even be a single entrypoint with an arg saying which enum in the imports table to use and which "get lsitens" method
      • 2022-01-12 01231, 2022

      • lucifer
        yeah that but maybe add some delays to avoid running too frequently.
      • 2022-01-12 01247, 2022

      • lucifer
        separate container for each importer?
      • 2022-01-12 01255, 2022

      • mayhem
        yep, all that.
      • 2022-01-12 01219, 2022

      • lucifer
        sounds good.
      • 2022-01-12 01226, 2022

      • mayhem
        and I think we ought to try and predict when a user will need to be checked next.
      • 2022-01-12 01237, 2022

      • mayhem
        get a listen, set the next check for avg listen length.
      • 2022-01-12 01204, 2022

      • mayhem
        no listen, check less frequently.
      • 2022-01-12 01237, 2022

      • lucifer
        yeah makes sense
      • 2022-01-12 01204, 2022

      • mayhem
        and then check as theses timeouts are reached per user.
      • 2022-01-12 01218, 2022

      • alastairp
        lucifer: separate container, or 2 runit services in 1 container. implemetnation detail
      • 2022-01-12 01232, 2022

      • lucifer
        makes sense.
      • 2022-01-12 01245, 2022

      • lucifer
        okay, i just remembered another PR to discuss 😓 https://github.com/metabrainz/listenbrainz-server…
      • 2022-01-12 01221, 2022

      • alastairp
        yeah, users who import something their time around the loop should be priority for the next time around the loop. if they don't import (within time limits of the song), start falling down the priority queue. ensure that all users are checked every x time
      • 2022-01-12 01222, 2022

      • lucifer
        so this is about showing the artists when the use hovers on a country in the map.
      • 2022-01-12 01239, 2022

      • mayhem
        alastairp: that
      • 2022-01-12 01245, 2022

      • lucifer
        👍
      • 2022-01-12 01213, 2022

      • mayhem
        > Artist names from the same country are repeated because we explode the list of artist mbids when calculating countries. One possible solution is to only show the name only once and link it to the first artist mbid only. This is what we do elsewhere from artist links anyways.
      • 2022-01-12 01235, 2022

      • mayhem
        here I would be inclined to treat this as the artists individually and not the artist_credit.
      • 2022-01-12 01253, 2022

      • lucifer
        makes sense but we don't have the artist name available here.
      • 2022-01-12 01203, 2022

      • mayhem
        and this only list the artists that are actually associated with the given country.
      • 2022-01-12 01215, 2022

      • lucifer
        we only have the artist_credit_name.
      • 2022-01-12 01238, 2022

      • mayhem
        then we should switch the back-end to use an array of artists_mbids
      • 2022-01-12 01250, 2022

      • mayhem
        with an array of artist_names
      • 2022-01-12 01256, 2022

      • mayhem
        (or a dict of both)
      • 2022-01-12 01215, 2022

      • lucifer
        we do have artist mbids on the backend but getting artist names from artist mbids is an extra query.
      • 2022-01-12 01223, 2022

      • lucifer
        can we add this to the country endpoint?
      • 2022-01-12 01242, 2022

      • lucifer
        we currently don't have another use case for this anyways.
      • 2022-01-12 01254, 2022

      • mayhem
      • 2022-01-12 01259, 2022

      • lucifer
        yes
      • 2022-01-12 01250, 2022

      • mayhem
        should be doable. open me a ticket.
      • 2022-01-12 01258, 2022

      • lucifer
        will do.
      • 2022-01-12 01207, 2022

      • mayhem runs off to be on a call
      • 2022-01-12 01213, 2022

      • lucifer
        the other two points remain then.
      • 2022-01-12 01217, 2022

      • lucifer
        ah ok 👍
      • 2022-01-12 01223, 2022

      • mayhem
        back in 30 mins, sorry.
      • 2022-01-12 01240, 2022

      • lucifer
        no worries, you alrady helped a lot :D
      • 2022-01-12 01203, 2022

      • lucifer
        akshaaatt: re the video, it used the old MB site so that irks me a bit but this is probably the closest we can use so fine by me.
      • 2022-01-12 01213, 2022

      • mayhem returns
      • 2022-01-12 01232, 2022

      • akshaaatt
        Okaaay lucifer!
      • 2022-01-12 01242, 2022

      • akshaaatt
        Also, only when you're free, we could do some updates for the mb app on the console lucifer
      • 2022-01-12 01219, 2022

      • lucifer
        sure sounds good
      • 2022-01-12 01231, 2022

      • lucifer
        mayhem, thoughts on the remaining two points? large number of artists in the country but links are not clickable.
      • 2022-01-12 01218, 2022

      • lucifer
        or we should probably wait for monkey to be available for this?
      • 2022-01-12 01204, 2022

      • mayhem
        shortening the list to 5 is good, but then we have a loss of info.
      • 2022-01-12 01237, 2022

      • mayhem
        if MB had a "show artists for this country page", that would be good. but even that doesn't work well for countries with a lot of artists.
      • 2022-01-12 01242, 2022

      • lucifer
        i was hoping a side legend sort of thing that is scrollable and lists all artists of the clicked country.
      • 2022-01-12 01255, 2022

      • mayhem
        I'd say we start with max 10 and see what users say
      • 2022-01-12 01210, 2022

      • lucifer
        cool sounds good.
      • 2022-01-12 01217, 2022

      • mayhem
        a legend would be nice too, but lets just keep it simple for now.
      • 2022-01-12 01240, 2022

      • lucifer
        unfortunately the links will be unclickable currently because the tooltip moves with the cursor.
      • 2022-01-12 01250, 2022

      • mayhem
        as for the third point, it screams that a tooltip is the wrong UI component for this.
      • 2022-01-12 01201, 2022

      • lucifer
        yeah indeed
      • 2022-01-12 01217, 2022

      • mayhem
        we should use a pop-up of some sort, not a tool-tip.