Freso: i've sent https://listenbrainz.org/user/hds a warning about their consistent spam to ListenBrainz. However, i do want to loop you in here given that you're community manager. I'm gonna delete their listens at least for sure, because it's messing with our data enough that their artist is one of the most listened artists on LB because of their spam.
2020-08-21 23416, 2020
IAmTheBlackMetal
Hi all, I have been working on some python code for an app that I am hoping to build and I have run into a small problem. I was hoping to return the country of artists if the data is available and I was noticing that a larger than normal amount of artists would return no country. Looking into it, I found that my code (using get_artist_by_id would
2020-08-21 23416, 2020
IAmTheBlackMetal
sometimes return just a city or other similar geographic location. From what I've seen, all of these instances, the musicbrainz page for said artist includes the returned location as well as all parent locations (aka often country, sometimes province/state/region/etc.). If I were to try using the includes=['area-rels'] option on my query, I often
2020-08-21 23417, 2020
IAmTheBlackMetal
get nothing extra. If I then take the area id of the city (or whatever geographic region is returned) and try a get_area_by_id to get more information, I will often get other related areas but never a parent area. TL;DR I was wondering if there was something I was missing for how to return just the country of an artist or at least search an area
2020-08-21 23417, 2020
IAmTheBlackMetal
to find it's parent country.
2020-08-21 23425, 2020
antlarr has quit
2020-08-21 23429, 2020
shivam-kapila
iliekcomputers: ping
2020-08-21 23436, 2020
shivam-kapila
I need a lil help
2020-08-21 23441, 2020
iliekcomputers
what's up
2020-08-21 23404, 2020
shivam-kapila
I have a feedbackList state in RecentListens
2020-08-21 23413, 2020
shivam-kapila
that stores rec_msid: score
2020-08-21 23445, 2020
shivam-kapila
I want to pass the score to the listen card for the corresponding listen
2020-08-21 23429, 2020
shivam-kapila
I want to do something like currentFeedback = {feedbackList["listen.track_metadata?.additional_info?.recording_msid"]}
2020-08-21 23447, 2020
shivam-kapila
so how would you suggest I extract that value
2020-08-21 23459, 2020
iliekcomputers
make it a function?
2020-08-21 23414, 2020
iliekcomputers
getFeedbackForRecordingMsid
2020-08-21 23426, 2020
shivam-kapila
hm yes. But if the state updates will the function be called itself
2020-08-21 23429, 2020
shivam-kapila
?
2020-08-21 23451, 2020
iliekcomputers
i don't understand
2020-08-21 23451, 2020
shivam-kapila
and pass the updated value to the ListenCard
2020-08-21 23411, 2020
iliekcomputers
let's start from the beginning
2020-08-21 23416, 2020
iliekcomputers
what are you really trying to do
2020-08-21 23419, 2020
shivam-kapila
ok
2020-08-21 23449, 2020
shivam-kapila
so RecentListens holds a state feedbackList containing key value pairs of rec_msid: score
2020-08-21 23459, 2020
shivam-kapila
for all the listens on that page
2020-08-21 23414, 2020
iliekcomputers
right.
2020-08-21 23434, 2020
iliekcomputers
and you pass the feedback for each listen to the ListenCard component
2020-08-21 23440, 2020
shivam-kapila
yes
2020-08-21 23444, 2020
iliekcomputers
ok.
2020-08-21 23401, 2020
shivam-kapila
Now when I like a listen I will update the record in feedbackList state
2020-08-21 23415, 2020
iliekcomputers
mhmm
2020-08-21 23430, 2020
shivam-kapila
now in case this update occurs I want the new value to be passed to ListenCard
2020-08-21 23453, 2020
iliekcomputers
if the state on the parent component is updated, everything is re-rendered
2020-08-21 23402, 2020
shivam-kapila
so that in case I like only 1 listen for a rec_msid but all listens for that rec_msid are liked
2020-08-21 23416, 2020
iliekcomputers
so that should happen automatically if you change the state on RecentListens
2020-08-21 23421, 2020
shivam-kapila
> if the state on the parent component is updated, everything is re-rendered
2020-08-21 23422, 2020
shivam-kapila
Each child component?
2020-08-21 23425, 2020
iliekcomputers
yes
2020-08-21 23439, 2020
shivam-kapila
oh nice... I was missing this fact
2020-08-21 23441, 2020
shivam-kapila
Thanks
2020-08-21 23405, 2020
iliekcomputers
afaik
2020-08-21 23424, 2020
iliekcomputers
if the state OR the props change, the render function is called again entirely
2020-08-21 23439, 2020
iliekcomputers
meaning everything gets rerendered
2020-08-21 23455, 2020
shivam-kapila
oh I get confued in this everytime :/
2020-08-21 23426, 2020
antlarr joined the channel
2020-08-21 23440, 2020
iliekcomputers
ishaanshah: i ran the stat without the mapping and it worked reasonably.
2020-08-21 23401, 2020
iliekcomputers
i've now run the weekly stat with mapping and it's been running for 10 min :/