maliya241 / personal-music-database

0 stars 0 forks source link

Duplicate Data In get_and_expand_multiple_property_values Function with Multiple Property Value Arrays #21

Open maliya241 opened 1 year ago

DarshanDixit05 commented 1 year ago

Hi @maliya241 , can you please brief me a bit about this issue? I want to work on it.

maliya241 commented 1 year ago

Hello @DarshanDixit05. I wasn't quite expecting for someone to find my little project, but please feel free to work on it or fork it for yourself. I'm not used to working with others on Github, so we'll see how merging works later. I'll try to add more about the project in general in the readme later.

As for the specific issue, the get_and_expand_multiple_property_values function, which is found in data_functions.js, makes a new object array filled with properties and values from a given object and an array of given keynames. The object properties may contain arrays. This function is supposed to break up each array and put it into its own object with its other corresponding property values. It works if there is only one property that contains arrays. The issue comes up when there are multiple properties that contain arrays. It creates objects with duplicate values -- as shown below.

Duplicate_Issue

There should be duplicate values if the original data object array contains duplicate data. However, this function is creating duplicate objects when it should not.

The function is called in song_year_released_artist_timeline.js. It's pulling data from songs.js. I believe I have taken out all the debuging code for it and the extra property name that causes the problem in the function's argument for now.

Right now, I don't anticipate the need for getting multiple properties that contain arrays, but I have noted as an issue just so I remember this problem does exist.

Thank you for being interested and working on it if you decide to do so.