adam-codersgu / supernova

A Kotlin-based Android application that allows the user to play music from their device while custom animations fall over the album artwork of the currently playing song.
0 stars 0 forks source link

Albums with titles containing foreign characters appear in the music library twice #10

Closed adam-codersgu closed 1 year ago

adam-codersgu commented 2 years ago

For some reason album titles with a foreign character appear in the music library twice, when the files exist only once. I'm seeing this with A mis 33 años by Julio Iglesias. The album appears under A mis 33 años and A mis 33 anos

adam-codersgu commented 1 year ago

Reviewed the database. It seems one song has the foreign character in the album title while all others have a more regular accented character. On Windows, all songs have the same album title, so no apparent difference in the raw metadata. It seems to be something to do with either the media store, the processing of media store metadata, or the saving of that data in the database. I'm wondering if the best solution here is to just identify the areas of the app that are affected and change the coding methodology so they process Album titles in a consistent manner that avoids duplicating data. I will also see if anything jumps out at me in terms of how song metadata is processed when the music library is built

adam-codersgu commented 1 year ago

Further investigation shows the foreign character discrepancy is visible as early as when the metadata is extracted from the media store cursor. So it is definitely not a Room/database issue

adam-codersgu commented 1 year ago

I've updated affected areas of the app e.g. SearchFragment to filter albums based on the albumId field rather than albumTitle. This has fixed the issue from a user perspective

adam-codersgu commented 1 year ago

I'm happy this has been fixed as well as it can be fixed