JayThomason / Tutti

Tutti is a shared music application for the car being made in conjunction with Audi.
3 stars 1 forks source link

Bug: Album art displayed on phones is not always the same in the artist view #215

Open JayThomason opened 10 years ago

JayThomason commented 10 years ago

The album art that is displayed one both phones is not consistent in the artist view, although it is consistent in the album view. This indicates that the wrong album art is being set at some point in the album art exchange process.

hwray commented 10 years ago

This is actually a really interesting issue. The Artists tab adapter simply runs a DB query with a GROUP BY on artists. So, the view row for each artist is based on a single song row from the DB. If this song entry happens to have album art set, then the album art will appear; if not, no album art will appear.

I'm not sure exactly why different phones seem to retrieve different rows in response to the GROUP BY clause. It may do something arbitrary, like returning the row with the greatest unique ID that meets the group requirement. I'll look into further parameterizing the GROUP BY clause to make things consistent across phones. It may be as simple as adding another SORT BY clause to prioritize displaying song rows that don't have an empty album art field.

hwray commented 10 years ago

It looks like we could also try adding another WHERE clause, specifying that the album art shown on the Artists tab should not be default. However, we'd have to watch out for the case when we're grouping by an artist who has no associated album art whatsoever.

http://www.tutorialspoint.com/sqlite/sqlite_group_by.htm

hwray commented 10 years ago

Sorry to blow up the issues page - but the HAVING clause looks like exactly what we need. However, I'm still not sure what to do in the case of retrieving artists who have no non-default album art.

http://www.tutorialspoint.com/sqlite/sqlite_having_clause.htm

tmyk

JayThomason commented 10 years ago

I have two comments here which are not technical, but something to keep in mind when we fix this.

  1. What I think we want to do (this is up for debate) is preserve the album art that has already been set in the artist tab prior to the new client joining, unless the new client has album art for some artist already in the jam and the jam does not.
  2. When the new client has album art for an artist already in the jam and the jam does not have any album art, we should set and remove album art correspondingly.