BimmerGestalt / AAIdrive

Implementations of some Android Auto features as unofficial IDrive apps
MIT License
540 stars 90 forks source link

AAIDRIVE_LIKED_SONGS gets messed up #588

Open daniel1v opened 2 years ago

daniel1v commented 2 years ago

From time to time, the AAIDRIVE_LIKED_SONGS playlist gets out of sync. The songs are in a different order and there is no easy way to fix this. I tried to trigger a re-sync by adding a new song, but the song was added only to the already messed up playlist. Also deleting the playlist and clearing AAIs cache did not help. Only a complete reset off AAI resolved the issue.

Unfortunately, I could not find out, when this issue haplens. So my maybe someone could add a button to manually trigger a complete recreation of the playlist?

I am using the latest nightly version and latest Spotify from Playstore, but I also had this issue with older versions of both apps.

hufman commented 2 years ago

I'm not sure how it would get into such a state, though I have occasionally seen this bug too. The playlist handling logic seems pretty simple, and should replace the entries automatically. Perhaps the queueItems.hashCode isn't changing, but it seems like it should change whenever the contents change.

daniel1v commented 2 years ago

Would it be possible to implement a button to start a manual reset / sync? This would avoid the need to completely reset the app.

Maybe somewhere in the advanced settings section.

hufman commented 2 years ago

I do not want to add a manual button to work around this bug, I would much rather have the bug be fixed :) @Ben2356 any ideas on how to make the cached playlist information less sticky?

Ben2356 commented 2 years ago

I have a couple of ideas that are really simple like using the size of the Liked Songs playlist in addition to the hashcode (in order to catch same size changes) or since the Like Songs playlist is typically sorted by recently added by default if that is honored in the GET request to the Web API we can just look at the most recent MusicMetadata to see if it changes (we'd store the hashcode of that last entry). I'll try and see if I can recreate this issue consistently to observe what is happening here since I'm confused how the ordering can change like that unless the Web API is returning an inconsistent ordering (which shouldn't matter since the hashcodes would be the same)

JollyJumper88 commented 1 year ago

Also having Problem with async liked songs playlist. It only plays the first song now.. did not know how to fix and deleted the aaidrive playlist. Will it be recreated?

JollyJumper88 commented 1 year ago

Any news on this?