Frick / ttplus

Turntable Plus - a fan-made Chrome Extension!
http://turntableplus.fm
48 stars 16 forks source link

Song Queue Count Discrepencies #37

Closed Izzmo closed 11 years ago

Izzmo commented 11 years ago

I have gotten a few messages from people using yours and my UI in line with each other and they both show queue counts. But some people are reporting that they are showing different numbers, mine usually higher than yours.

I looked at the code and you are getting your count from turntable.playlist.files and I am getting from turntable.playlist.songsByFid.

Do you know what the difference is? On my personal account there is no difference, but on, for example, SocialB's account, she is showing ~3400 songs from turntable.playlist.songsByFid and ~2770 from turntable.playlist.files.

Frick commented 11 years ago

I'm honestly not sure why they're showing different counts, you'd expect to see the same number in each since one is just the metadata of the other. I can ask, but when I originally chose to use turntable.playlist.files.length it was because it was showing the same result as $('.song').length (which is now different due to how the queue is loaded into the DOM). I just used my ability to check in the actual TT DB (handy sometimes) and the turntable.playlist.files.length method is showing an accurate count for myself. SocialB shows as having 2,894 songs in her queue via the DB.

Izzmo commented 11 years ago

Interesting, I guess I'll update it to use turntable.playlist.files instead.

Thanks for checking @Frick!

Izzmo commented 11 years ago

Also- just a thought:

SocialB was telling me she has been deleting a lot of songs lately (to get under 3,000 songs in her queue as well as just deleting old mashups). So maybe playlist.songsByFid is getting all songs, deleted and active, from the DB and playlist.files are active only.

Frick commented 11 years ago

As soon as you delete a file, it's gone from the DB... no way to get those. So if you refresh after deleting a bunch, the most files it can grab are all the files in your playlist.

Izzmo commented 11 years ago

Ah, okay.