Bug fixing

- isPlayerPrepared() illegalState bug fixed
- tag editor bug fixed when track number field is empty
- updated the tag editor track field hint
This commit is contained in:
Karim Abou Zeid 2015-02-07 12:44:58 +01:00
commit 6b514c0c0a
4 changed files with 8 additions and 3 deletions

View file

@ -210,7 +210,7 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe
}
public boolean isPlaying() {
return player != null && player.isPlaying();
return player != null && isPlayerPrepared && player.isPlaying();
}
private void notifyOnMusicRemoteEventListeners(int event) {

View file

@ -335,7 +335,11 @@ public abstract class AbsTagEditorActivity extends ActionBarActivity {
AudioFile audioFile = AudioFileIO.read(new File(songPath));
Tag tag = audioFile.getTagOrCreateAndSetDefault();
for (Map.Entry<FieldKey, String> entry : fieldKeyValueMap.entrySet()) {
tag.setField(entry.getKey(), entry.getValue());
try {
tag.setField(entry.getKey(), entry.getValue());
} catch (NumberFormatException e) {
tag.deleteField(entry.getKey());
}
}
if (deleteArtwork) {
tag.deleteArtworkField();