MaxFour / Music-Player

Lightweight and Material designed Music Player
GNU General Public License v3.0
283 stars 71 forks source link

Fix for a Tag Editor crash with flac files #95

Open giacomozama opened 3 years ago

giacomozama commented 3 years ago

Whenever the uses saves changes in the Tag Editor, AbsTagEditorActivity calls Tag.setField(Artwork). After that, if Artwork.isLinked() returns false, the FlacTag implementation of Tag causes Artwork.setImageFromData() to be called while creating the field, which throws an UnsupportedOperationException for AndroidArtwok. This change introduces a workaround by creating the field manually and using Tag.setField(TagField) whenever we have to deal with non-linked artworks and FlacTags.

If left the isLinked() check there, even though I'm not sure it's necessary as Music-Player might only create non-linked artworks.