Cider
Cider copied to clipboard
[Bug]: Songs Menu with Sort By 'Date Added' is in a mixed/corrupt order
Describe the Bug
The order of songs in the Songs menu when using Sort By 'Date Added' is incorrect every time I fresh-install Cider. First of all I want to make it clear that 99% of the time I've added songs to my list under cider, except for the first bulk of maybe 400-500 songs. I currently have 513 songs in my library. I'm 100% sure at least the 12 most recent songs were added by Cider to the library.
This is what Cider is showing as my most recently added songs after a non-clean re-install (beta425->beta443):
- The list is slightly right, mostly incorrect.
- 'Faster Car', and 'Light It Up' are one of the first songs I've added to my Library directly on my iPhone.
- 'Just a Girl' is actually the most recent song I've added, not 'Don't Play'.
This is what Cider is showing as my least recently added songs, this is within the same installation as the image above:
- These songs are yet again, slightly right, yet as of now almost entirely wrong.
- These are almost the right songs for my 2nd last clean install. The one before my last re-install, I believe from beta417->beta425.
- Yet these are in my least-recently added songs order? Strange.
This is what my actual latest added songs are:
It seems clear that every time Cider has to populate its memory of recently added songs/song order, it gets it somewhat incorrect in a way that's different each time it collects that information. I'm also aware of at least one other user on the Cider discord with this same issue. This issue is one of my most annoying gripes about Cider currently and makes it a PITA to use after each update.
Steps to Reproduce
- Either Update Cider to a new version, or uninstall Cider using just the uninstaller and reinstall Cider. I'm not 100% sure if installing (either clean or not) the same version you used previously will work.
- Go to the songs list and refresh your Library.
- Click Sort By -> 'Date Added', and set the Order By -> 'Descending'.
- We would expect the songs list to match iTunes at this point but it doesn't.
Environment Information
- OS: Windows 11
- App Version and/or Commit ID: beta443 but has definitely been happening since beta417
Anything else?
EDIT 2 weeks later:
I added Alien
song by Galantis (the one appearing at the top), and added the highlighted Not Over Yet
song by KSI as well. Both of these were added about 5-10 minutes apart, and no library refresh took part for either yet. Once I went to my Songs list I changed to Descending and it auto refreshed and the positions of the song appeared like so.
It looks like it is correct if it's trying to match by album, which I believe it is, and that it's the only way the MusicKit API lets us have a recent song list. But even if this is somewhat correct behavior, it's not ideal in any way when iTunes can list them in actual recently added order. Perhaps for the song library, we could use an alternative API, maybe some research into what iTunes is doing could be useful.
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
I would also like to make it clear that the Recently Added page of Cider is in the correct order too.
I found the Order By option either Descending or Ascending always gives me wrong result. Cider 1.5.1-beta 455
Same here on the Windows Store version 1.5.2.0
same here on GitHub version 1.5.4-beta.34
Something I've noticed in the code is that the Sorting code for int
data first subtracts it from the current timestamp. This is completely unnecessary and floating point errors could be somewhat of an issue. I don't know the codebase or vue ecosystem almost at all and I'm just guessing here but could the issue be stacked operations of subtractions each refresh?
E.g., it subtracts the timestamp in a non-issue way on the first load, the second load then does the exact same, subtracts again but its subtracting from the already subtracted data, leading to likely negative values depending on the offset from when the song was added, and the current time.
Something I've noticed in the code is that the Sorting code for
int
data first subtracts it from the current timestamp. This is completely unnecessary and floating point errors could be somewhat of an issue. I don't know the codebase or vue ecosystem almost at all and I'm just guessing here but could the issue be stacked operations of subtractions each refresh?E.g., it subtracts the timestamp in a non-issue way on the first load, the second load then does the exact same, subtracts again but its subtracting from the already subtracted data, leading to likely negative values depending on the offset from when the song was added, and the current time.
please help. that code sucks
Issue still present on cider 15.6-beta.8
Issue fixed in 5099d41260515c2496d33a817b6e36a9f4a45069