Lightw3ight / PlayMeExtension

A Chrome extension for the Play Me jukebox
5 stars 3 forks source link

Create trackby for lists #16

Closed SkyeBelinda closed 5 years ago

SkyeBelinda commented 5 years ago

adding trackBy everywhere

overflew commented 5 years ago

Hi Skye - great work, thanks!

Using index for trackBy should work for this in most cases, as usually items are added to the end of the list (likes/vetoes, songs newly queued)

One thing I think we need to adapt: When items are added or removed from the first position of a list. I think this applies to:

Can we please make a trackById from the track.Id + find a unique, reproduceable identifier (is there a playedAtDate?). (trackBy will crash if there are duplicates)

I believe the same track Id can be queued by multiple people, and there's a hack where the same person can queue the same track multiple times.

Thanks so much for your first pull request on this project :)

SkyeBelinda commented 5 years ago

Ok cool I'll take a look and add the id to the History component ( it has a StartedPlayingDateTime ) - do you know which one deals with 'Upcoming tracks' ?

overflew commented 5 years ago

Tested - LGTM